just as a note under mySQL I would use limit rather than count. eg.
my $sth = $dbh->prepare("select * from $table limit 1"); $sth->execute(); print "Theres at least 1 row" if $sth->rows();
That way you don't have to look through the whole table to create the result ( although it's possible that is optimized)
note: untestedUpdate: mahi's note below shows just why one should be careful about premature optimization. heh.
In reply to Re: DBI: Better way to find number of rows in a table?
by tedrek
in thread DBI: Better way to find number of rows in a table?
by anjiro
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |