Skip to content
Browse files

Fix postgre db_connect()

  • Loading branch information...
1 parent 05aa2d6 commit c07c4855f808a0b3c0aac7d8056f38161185a4c7 @narfbg narfbg committed
Showing with 6 additions and 6 deletions.
  1. +6 −6 system/database/drivers/postgre/postgre_driver.php
View
12 system/database/drivers/postgre/postgre_driver.php
@@ -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;
}
// --------------------------------------------------------------------

0 comments on commit c07c485

Please sign in to comment.
Something went wrong with that request. Please try again.