bory has asked for the wisdom of the Perl Monks concerning the following question:
In this way it's printing nothing when the database is empty, and when there is something in the database it's printing "database is empty" for every $email. Thank you very much for your time.my $sth=$dbh->prepare("SELECT Email FROM foo "); $sth->execute(); while (my $email=$sth->fetchrow_array ) { if ($email=""){ print "Database is empty"; } else { print $email; } } $sth->finish;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do i check if a mysql database is empty?
by edan (Curate) on Nov 27, 2003 at 08:12 UTC | |
|
Re: How do i check if a mysql database is empty?
by Itatsumaki (Friar) on Nov 27, 2003 at 08:02 UTC | |
|
Re: How do i check if a mysql database is empty?
by holo (Monk) on Nov 27, 2003 at 08:03 UTC | |
by edan (Curate) on Nov 27, 2003 at 08:07 UTC |