Wow. That's a lot of code. Personally I'd just do:
$count = $dbh->selectrow_array("select count(*) from ...") or die ...;
(and the "or die" isn't needed if you're using RaiseError.)
Tim.
On Tue, Nov 12, 2002 at 01:01:21PM -0500, Vorce, Tim (T.) wrote:
> Just like any other return from the database
>
> $sql_text= "select count(*) from ....
>
>
> $cursor = $dbh->prepare($sql_text);
> if (!$cursor)
> {
> # error creating cursor
> $value=0;
> } # !cursor
> unless ($cursor->execute)
> {
> $value=0;
> # can't execute
> }
> $value =$cursor->fetchrow;
>
> Tim Vorce
> Ford Motor Company
> [EMAIL PROTECTED]
>
>
> -----Original Message-----
> From: Stephane Legault [mailto:slegault@;ca.ibm.com]
> Sent: Tuesday, November 12, 2002 12:56 PM
> To: [EMAIL PROTECTED]
> Subject: how to fetch the result of a select count statement?
>
>
> I do a lot of select in many statement and fetch the result on a array as
> needed. But now one of my staement is a "select count() from ...". How can
> I get the value of this statement?
>