Skip to content

Commit

Permalink
Fix mysql's db_connect()
Browse files Browse the repository at this point in the history
  • Loading branch information
narfbg committed Oct 12, 2012
1 parent 2f8bf9b commit 98ebf43
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions system/database/drivers/mysql/mysql_driver.php
Expand Up @@ -81,15 +81,16 @@ public function __construct($params)
*/
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)
{
$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);
}

// --------------------------------------------------------------------
Expand Down

0 comments on commit 98ebf43

Please sign in to comment.