summaryrefslogtreecommitdiffstats
path: root/system/database/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers')
-rw-r--r--system/database/drivers/pdo/pdo_driver.php2
-rw-r--r--system/database/drivers/postgre/postgre_driver.php10
-rw-r--r--system/database/drivers/sqlsrv/sqlsrv_driver.php2
3 files changed, 11 insertions, 3 deletions
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index b36a3d927..705b16560 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -366,7 +366,7 @@ class CI_DB_pdo_driver extends CI_DB {
protected function _update_batch($table, $values, $index, $where = NULL)
{
$ids = array();
- $where = ($where !== '' && count($where) >=1) ? implode(" ", $where).' AND ' : '';
+ $where = ($where !== '' && count($where) >=1) ? implode(' ', $where).' AND ' : '';
foreach ($values as $key => $val)
{
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php
index 031740851..8c11c477b 100644
--- a/system/database/drivers/postgre/postgre_driver.php
+++ b/system/database/drivers/postgre/postgre_driver.php
@@ -132,7 +132,15 @@ class CI_DB_postgre_driver extends CI_DB {
*/
public function db_pconnect()
{
- return @pg_pconnect($this->dsn);
+ $conn = @pg_pconnect($this->dsn);
+ if ($conn && pg_connection_status($conn) === PGSQL_CONNECTION_BAD)
+ {
+ if (pg_ping($conn) === FALSE)
+ {
+ return FALSE;
+ }
+ }
+ return $conn;
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/sqlsrv/sqlsrv_driver.php b/system/database/drivers/sqlsrv/sqlsrv_driver.php
index 8bd18bd76..bda450e88 100644
--- a/system/database/drivers/sqlsrv/sqlsrv_driver.php
+++ b/system/database/drivers/sqlsrv/sqlsrv_driver.php
@@ -225,7 +225,7 @@ class CI_DB_sqlsrv_driver extends CI_DB {
*/
public function affected_rows()
{
- return sqlrv_rows_affected($this->result_id);
+ return sqlsrv_rows_affected($this->result_id);
}
// --------------------------------------------------------------------