Gossamer Forum
Home : General : Perl Programming :

SQL Count

Quote Reply
SQL Count
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


Subject Author Views Date
Thread SQL Count Wil 7129 Sep 26, 2001, 1:45 AM
Thread Re: [Wil] SQL Count
sh2sg 6921 Sep 26, 2001, 2:20 AM
Thread Re: [sh2sg] SQL Count
Wil 6916 Sep 26, 2001, 3:24 AM
Thread Re: [Wil] SQL Count
Matt G 6935 Sep 26, 2001, 7:01 AM
Post Re: [mglaspie] SQL Count
Wil 6879 Sep 26, 2001, 7:24 AM
Thread Re: [Wil] SQL Count
Stealth 6902 Sep 26, 2001, 8:11 AM
Post Re: [AnthroRules] SQL Count
Wil 6900 Sep 26, 2001, 8:13 AM
Thread Re: [sh2sg] SQL Count
Alex 6882 Sep 26, 2001, 9:57 AM
Thread Re: [Alex] SQL Count
Wil 6862 Sep 27, 2001, 1:29 AM
Post Re: sql row warning
Wil 6876 Sep 27, 2001, 6:41 AM
Thread Re: [Wil] SQL Count
Csson 6886 Oct 3, 2001, 3:23 PM
Post Re: [Csson] SQL Count
Wil 6802 Oct 7, 2001, 10:13 AM