in reply to DBI: Better way to find number of rows in a table?
If your DBI and the MySQL bits are recent, you can do this:
# $dbi handle is available my @non_empties = grep { # almost like jeffa's now $dbh->selectcol_arrayref("select count(*) from $_")->[0] } $dbh->tables;
Update: rnahi is correct, $sth->rows won't do. Repaired
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: DBI: Better way to find number of rows in a table?
by rnahi (Curate) on Jun 04, 2003 at 08:29 UTC |