Skip to content

Commit

Permalink
Fix postgre db_connect()
Browse files Browse the repository at this point in the history
  • Loading branch information
narfbg committed Dec 3, 2012
1 parent 05aa2d6 commit c07c485
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions system/database/drivers/postgre/postgre_driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,24 +139,24 @@ public function __construct($params)
public function db_connect($persistent = FALSE)
{
if ($persistent === TRUE
&& ($conn = @pg_pconnect($this->dsn))
&& pg_connection_status($conn) === PGSQL_CONNECTION_BAD
&& pg_ping($conn) === FALSE
&& ($this->conn_id = @pg_pconnect($this->dsn))
&& pg_connection_status($this->conn_id) === PGSQL_CONNECTION_BAD
&& pg_ping($this->conn_id) === FALSE
)
{
return FALSE;
}
else
{
$conn = @pg_connect($this->dsn);
$this->conn_id = @pg_connect($this->dsn);
}

if ($conn && ! empty($this->schema))
if ($this->conn_id && ! empty($this->schema))
{
$this->simple_query('SET search_path TO '.$this->schema.',public');
}

return $conn;
return $this->conn_id;
}

// --------------------------------------------------------------------
Expand Down

0 comments on commit c07c485

Please sign in to comment.