diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php
index d7018bf..9533ec6 100644
--- a/system/database/DB_utility.php
+++ b/system/database/DB_utility.php
@@ -133,7 +133,11 @@
}
$query = $this->db->query($sql);
- return current($query->result_array());
+ $res = $query->result_array();
+
+ // Note: Due to a bug in current() that affects some versions
+ // of PHP we can not pass function call directly into it
+ return current($res);
}
// --------------------------------------------------------------------
@@ -159,7 +163,10 @@
$query = $this->db->query($sql);
// Build the result array...
- $res = current($query->result_array());
+ // Note: Due to a bug in current() that affects some versions
+ // of PHP we can not pass function call directly into it
+ $res = $query->result_array();
+ $res = current($res);
$key = str_replace($this->db->database.'.', '', current($res));
$keys = array_keys($res);
unset($res[$keys[0]]);
@@ -190,7 +197,11 @@
}
$query = $this->db->query($sql);
- return current($query->result_array());
+
+ // Note: Due to a bug in current() that affects some versions
+ // of PHP we can not pass function call directly into it
+ $res = $query->result_array();
+ return current($res);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index be7c672..1afc206 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -45,7 +45,7 @@
*/
function db_connect()
{
- return mysql_connect($this->hostname, $this->username, $this->password, TRUE);
+ return @mysql_connect($this->hostname, $this->username, $this->password, TRUE);
}
// --------------------------------------------------------------------
@@ -58,7 +58,7 @@
*/
function db_pconnect()
{
- return mysql_pconnect($this->hostname, $this->username, $this->password);
+ return @mysql_pconnect($this->hostname, $this->username, $this->password);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php
index 5942091..3a0d3b5 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -47,7 +47,7 @@
*/
function db_connect()
{
- return mysqli_connect($this->hostname, $this->username, $this->password);
+ return @mysqli_connect($this->hostname, $this->username, $this->password);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php
index c091edf..551a670 100644
--- a/system/database/drivers/oci8/oci8_driver.php
+++ b/system/database/drivers/oci8/oci8_driver.php
@@ -62,7 +62,7 @@
*/
function db_connect()
{
- return ocilogon($this->username, $this->password, $this->hostname);
+ return @ocilogon($this->username, $this->password, $this->hostname);
}
// --------------------------------------------------------------------
@@ -75,7 +75,7 @@
*/
function db_pconnect()
{
- return ociplogon($this->username, $this->password, $this->hostname);
+ return @ociplogon($this->username, $this->password, $this->hostname);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php
index 09ca07e..4d1fac2 100644
--- a/system/database/drivers/odbc/odbc_driver.php
+++ b/system/database/drivers/odbc/odbc_driver.php
@@ -38,7 +38,7 @@
*/
function db_connect()
{
- return odbc_connect($this->database, $this->username, $this->password);
+ return @odbc_connect($this->database, $this->username, $this->password);
}
// --------------------------------------------------------------------
@@ -51,7 +51,7 @@
*/
function db_pconnect()
{
- return odbc_pconnect($this->database, $this->username, $this->password);
+ return @odbc_pconnect($this->database, $this->username, $this->password);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/postgre/postgre_driver.php b/system/database/drivers/postgre/postgre_driver.php
index 81aaafe..68fde01 100644
--- a/system/database/drivers/postgre/postgre_driver.php
+++ b/system/database/drivers/postgre/postgre_driver.php
@@ -40,7 +40,7 @@
{
$port = ($this->port == '') ? '' : " port=".$this->port;
- return pg_connect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password);
+ return @pg_connect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password);
}
// --------------------------------------------------------------------
@@ -55,7 +55,7 @@
{
$port = ($this->port == '') ? '' : " port=".$this->port;
- return pg_pconnect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password);
+ return @pg_pconnect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/sqlite/sqlite_driver.php b/system/database/drivers/sqlite/sqlite_driver.php
index ce3c579..3f71b35 100644
--- a/system/database/drivers/sqlite/sqlite_driver.php
+++ b/system/database/drivers/sqlite/sqlite_driver.php
@@ -40,14 +40,16 @@
*/
function db_connect()
{
- if ( ! $conn_id = sqlite_open($this->database, 0666, $error))
+ if ( ! $conn_id = @sqlite_open($this->database, 0666, $error))
{
log_message('error', $error);
if ($this->db_debug)
{
$this->display_error($error, '', TRUE);
- }
+ }
+
+ return FALSE;
}
return $conn_id;
@@ -63,14 +65,16 @@
*/
function db_pconnect()
{
- if ( ! $conn_id = sqlite_popen($this->database, 0666, $error))
+ if ( ! $conn_id = @sqlite_popen($this->database, 0666, $error))
{
log_message('error', $error);
if ($this->db_debug)
{
$this->display_error($error, '', TRUE);
- }
+ }
+
+ return FALSE;
}
return $conn_id;