This won't work as expected.
$sth->rows returns the number of affected rows, and since in this case there are none, (COUNT is not a row affecting command) it will return -1, thus making TRUE all the items in the array. Therefore grep will return all the tables, even the empty ones.
In reply to Re: Re: DBI: Better way to find number of rows in a table?
by rnahi
in thread DBI: Better way to find number of rows in a table?
by anjiro
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |