Home: Perl Programming Help: DBI:
SHOW Databases



erichmusickwc
Novice

Jun 19, 2003, 2:53 PM


Views: 5946
SHOW Databases

This may be a silly question, but I can't seem to find an answer. How do I execute the mysql command SHOW databases via DBI.


Jasmine
Administrator / Moderator

Jun 20, 2003, 5:36 AM


Views: 5944
Re: [erichmusickwc] SHOW Databases


Code
my $sth = $dbh->prepare( 'SHOW DATABASES' ) or die "Can't prepare: $DBI::errstr\n"; 

$sth->execute() or die "Can't execute: $DBI::errstr\n";



erichmusickwc
Novice

Jun 20, 2003, 8:16 AM


Views: 5940
Re: [Jasmine] SHOW Databases

Hmm....it worked now. Before, I was having problems connecting to mysql without specifying a db to use. Maybe I was just doing something else wrong.

Oh well thanks for your help!

Erich Musick