You are here

function DB_mysql::numCols in Flickr API 5

Gets the number of columns in a result set

This method is not meant to be called directly. Use DB_result::numCols() 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 columns. A DB_Error object on failure.

See also

DB_result::numCols()

File

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

Class

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

Code

function numCols($result) {
  $cols = @mysql_num_fields($result);
  if (!$cols) {
    return $this
      ->mysqlRaiseError();
  }
  return $cols;
}