summaryrefslogtreecommitdiffstats
path: root/system/database
diff options
context:
space:
mode:
authoradmin <devnull@localhost>2006-10-23 23:37:22 +0200
committeradmin <devnull@localhost>2006-10-23 23:37:22 +0200
commit7acd581d9441fb8ada4c46c58f4ec30a01507506 (patch)
tree6e62cffa5d1da5b60dfe06fa0338bf1ac78011f7 /system/database
parentca335fcd8342ec1422a63ac397a404e73766b0ef (diff)
Diffstat (limited to 'system/database')
-rw-r--r--system/database/DB_utility.php17
-rw-r--r--system/database/drivers/mysql/mysql_driver.php4
-rw-r--r--system/database/drivers/mysqli/mysqli_driver.php2
-rw-r--r--system/database/drivers/oci8/oci8_driver.php4
-rw-r--r--system/database/drivers/odbc/odbc_driver.php4
-rw-r--r--system/database/drivers/postgre/postgre_driver.php4
-rw-r--r--system/database/drivers/sqlite/sqlite_driver.php12
7 files changed, 31 insertions, 16 deletions
diff --git a/system/database/DB_utility.php b/system/database/DB_utility.php
index d7018bf2b..9533ec607 100644
--- a/system/database/DB_utility.php
+++ b/system/database/DB_utility.php
@@ -133,7 +133,11 @@ class CI_DB_utility {
}
$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 @@ class CI_DB_utility {
$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 @@ class CI_DB_utility {
}
$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 be7c672f7..1afc2062b 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -45,7 +45,7 @@ class CI_DB_mysql_driver extends CI_DB {
*/
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 @@ class CI_DB_mysql_driver extends CI_DB {
*/
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 59420912f..3a0d3b562 100644
--- a/system/database/drivers/mysqli/mysqli_driver.php
+++ b/system/database/drivers/mysqli/mysqli_driver.php
@@ -47,7 +47,7 @@ class CI_DB_mysqli_driver extends CI_DB {
*/
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 c091edf64..551a670fe 100644
--- a/system/database/drivers/oci8/oci8_driver.php
+++ b/system/database/drivers/oci8/oci8_driver.php
@@ -62,7 +62,7 @@ class CI_DB_oci8_driver extends CI_DB {
*/
function db_connect()
{
- return ocilogon($this->username, $this->password, $this->hostname);
+ return @ocilogon($this->username, $this->password, $this->hostname);
}
// --------------------------------------------------------------------
@@ -75,7 +75,7 @@ class CI_DB_oci8_driver extends CI_DB {
*/
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 09ca07ee4..4d1fac2ed 100644
--- a/system/database/drivers/odbc/odbc_driver.php
+++ b/system/database/drivers/odbc/odbc_driver.php
@@ -38,7 +38,7 @@ class CI_DB_odbc_driver extends CI_DB {
*/
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 @@ class CI_DB_odbc_driver extends CI_DB {
*/
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 81aaafe14..68fde01b1 100644
--- a/system/database/drivers/postgre/postgre_driver.php
+++ b/system/database/drivers/postgre/postgre_driver.php
@@ -40,7 +40,7 @@ class CI_DB_postgre_driver extends CI_DB {
{
$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 @@ class CI_DB_postgre_driver extends CI_DB {
{
$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 ce3c57935..3f71b3536 100644
--- a/system/database/drivers/sqlite/sqlite_driver.php
+++ b/system/database/drivers/sqlite/sqlite_driver.php
@@ -40,14 +40,16 @@ class CI_DB_sqlite_driver extends CI_DB {
*/
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 @@ class CI_DB_sqlite_driver extends CI_DB {
*/
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;