PEAR DB with MysQl - no of rows?

admin

Administrator
Staff member
hi, does anyone have any experience with pear db using mysql? i would like to know how to get the number of rows returned by a resultset! there are two functions: numCols and numRows in the class for postgres, but only numCols for mysql!

When I try to write my own function for numRows as follows:

function numRows($result)
{
$rows = mysql_num_rows($result);
if (!$rows)
{
return $this->raiseError($this->errorCode(mysql_errno($this->connection)));
}
return $rows;
}

..this does not work.

please help! how can i check for the no or rows returned?
 
Back
Top