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;
In reply to How do i check if a mysql database is empty? by bory
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |