in reply to Re: Right Number DB
in thread Right Number DB
And then retrieve the rowcount from the query result.SELECT count(*) FROM table where ...
There is a rowcount variable in the DBI, but I would not rely on it because it is not reliable (and database dependent?).$sth = $dbh->prepare($sql); $sth->execute(); if ($rowcount == 1) { # do single row logic # fetch data } else { # do multi-row logic # fetch data with while loop }
|
|---|