I've got the following code:
$sqlsrchresults = "SELECT * FROM geog WHERE name_en LIKE '%$A::name_en%' ORDER BY name_en";
$sth = $dbh->prepare($sqlsrchresults);
$sth->execute;
I need to return the number of results. I've tried:
$no_of_rows = $sth->numrows;
Which doesn't work. I don't really want to run another sql statement, COUNT() (which does work), because of performance reasons.
Is there a way, surely?!!, to do this?
Thanks
Wil
$sqlsrchresults = "SELECT * FROM geog WHERE name_en LIKE '%$A::name_en%' ORDER BY name_en";
$sth = $dbh->prepare($sqlsrchresults);
$sth->execute;
I need to return the number of results. I've tried:
$no_of_rows = $sth->numrows;
Which doesn't work. I don't really want to run another sql statement, COUNT() (which does work), because of performance reasons.
Is there a way, surely?!!, to do this?
Thanks
Wil