Deprecated: Assigning the return value of new by reference is deprecated in /home/bluestat/public_html/source/index.php on line 477
port = $port;
}
/**
* Wrapper: pg_connect
*/
protected function _connect($server, $user, $password, $database)
{
return pg_connect("host='$server' port={$this->port} user='$user' password='$password' dbname='$database'");
}
/**
* Wrapper: pg_escape_string
*/
protected function _escapeString()
{
return pg_escape_string($string);
}
/**
* Wrapper/no support: error string
*/
protected function _errorString()
{
if ($this->result)
{
return pg_result_error($this->result);
}
return pg_last_error($this->dblink);
}
/**
* Not supported: error numbers
*/
protected function _errorNumber()
{
return -1;
}
/**
* Overload: insertId
*/
public function insertId($table, $field)
{
return $this->queryFirst("SELECT last_value FROM {$table}_{$field}_seq")->fetchObject()->last_value;
}
protected function _insertId()
{}
/**
* Wrapper: pg_affected_rows
*/
protected function _affectedRows($result)
{
return pg_affected_rows($result);
}
/**
* Starts a database transaction
*/
public function begin()
{
$this->query("BEGIN");
}
/**
* Reverts a transaction back to a given savepoint
*/
public function rollback()
{
$this->query("ROLLBACK");
}
/**
* Commits a database transaction
*/
public function commit()
{
$this->query("COMMIT");
}
/**
* Returns the error number
*
* @return integer Error number
*/
public function _errorNumber()
{
return -1;
}
/**
* Returns the error string
*
* @return string Error string
*/
public function _errorString()
{
return pg_last_error($this->dblink);
}
}
/**
* Database Result
*
* This class holds result information for a database result
*
* @author rsesek
* @copyright Copyright (c)2005 - 2009, Blue Static
* @package ISSO
*
*/
class BSDbPostgreSqlResult extends BSDbResult
{
/**
* Wrapper: pg_fetch_assoc
*/
protected function _fetchAssocArray($result)
{
return pg_fetch_assoc($result);
}
/**
* Wrapper: pg_fetch_row
*/
protected function _fetchRowArray($result)
{
return pg_fetch_row($result);
}
/**
* Wrapper: pg_fetch_object
*/
public function _fetchObject($result)
{
return pg_fetch_object($result);
}
/**
* Wrapper: pg_free_result
*/
protected function _freeResult($result)
{
pg_free_result($result);
}
/**
* Wrapper: pg_num_rows
*/
protected function _numRows($result)
{
return pg_num_rows($result);
}
}
?>