You are here

function DB_pgsql::commit in Flickr API 5

Commits the current transaction

Return value

int DB_OK on success. A DB_Error object on failure.

Overrides DB_common::commit

File

phpFlickr/PEAR/DB/pgsql.php, line 606

Class

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

Code

function commit() {
  if ($this->transaction_opcount > 0) {

    // (disabled) hack to shut up error messages from libpq.a

    //@fclose(@fopen("php://stderr", "w"));
    $result = @pg_exec($this->connection, 'end;');
    $this->transaction_opcount = 0;
    if (!$result) {
      return $this
        ->pgsqlRaiseError();
    }
  }
  return DB_OK;
}