You are here

function DB_pgsql::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/pgsql.php, line 545

Class

DB_pgsql
The methods PEAR DB uses to interact with PHP's pgsql extension for interacting with PostgreSQL databases

Code

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