Web: in PHP < 5.3.0, mysqli doesn't support persistent connections

This commit is contained in:
David Anderson 2014-04-11 11:02:12 -07:00
parent 69f0696829
commit ec8200d0eb
1 changed files with 5 additions and 1 deletions

View File

@ -35,7 +35,11 @@ class DbConn {
function init_conn($user, $passwd, $host, $name) {
if (MYSQLI) {
$this->db_conn = new mysqli("p:".$host, $user, $passwd);
if (version_compare(PHP_VERSION, '5.3.0') < 0) {
$this->db_conn = new mysqli($host, $user, $passwd);
} else {
$this->db_conn = new mysqli("p:".$host, $user, $passwd);
}
} else {
$this->db_conn = mysql_pconnect($host, $user, $passwd);
}