From 98ebf4351f8aad58504cd7318ddd94faf0dec482 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Fri, 12 Oct 2012 20:44:03 +0300 Subject: Fix mysql's db_connect() --- system/database/drivers/mysql/mysql_driver.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'system/database/drivers') diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php index 336db971d..99bf55942 100644 --- a/system/database/drivers/mysql/mysql_driver.php +++ b/system/database/drivers/mysql/mysql_driver.php @@ -81,7 +81,6 @@ class CI_DB_mysql_driver extends CI_DB { */ public function db_connect($persistent = FALSE) { - $connect_func = ($persistent === TRUE) ? 'mysql_pconnect' : 'mysql_connect'; $client_flags = ($this->compress === FALSE) ? 0 : MYSQL_CLIENT_COMPRESS; if ($this->encrypt === TRUE) @@ -89,7 +88,9 @@ class CI_DB_mysql_driver extends CI_DB { $client_flags = $client_flags | MYSQL_CLIENT_SSL; } - return @$connect_func($this->hostname, $this->username, $this->password, TRUE, $client_flags); + return ($persistent === TRUE) + ? @mysql_pconnect($this->hostname, $this->username, $this->password, $client_flags) + : @mysql_connect($this->hostname, $this->username, $this->password, TRUE, $client_flags); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b