You are here

function DB_mysql::numRows in Flickr API 5

Gets the number of rows in a result set

This method is not meant to be called directly. Use DB_result::numRows() instead. It can't be declared "protected" because DB_result is a separate object.

Parameters

resource $result PHP's query result resource:

Return value

int the number of rows. A DB_Error object on failure.

Overrides DB_common::numRows

See also

DB_result::numRows()

File

phpFlickr/PEAR/DB/mysql.php, line 465

Class

DB_mysql
The methods PEAR DB uses to interact with PHP's mysql extension for interacting with MySQL databases

Code

function numRows($result) {
  $rows = @mysql_num_rows($result);
  if ($rows === null) {
    return $this
      ->mysqlRaiseError();
  }
  return $rows;
}