include port in pdo url when host is 'localhost'
This commit is contained in:
parent
1e6a491400
commit
d3369384d1
@ -62,6 +62,8 @@ class DBA {
|
||||
|
||||
|
||||
if(is_object(self::$dba) && self::$dba->connected) {
|
||||
if($server === 'localhost')
|
||||
$port = $set_port;
|
||||
$dns = ((self::$dbtype == DBTYPE_POSTGRES) ? 'postgres' : 'mysql')
|
||||
. ':host=' . $server . (is_null($port) ? '' : ';port=' . $port)
|
||||
. ';dbname=' . $db;
|
||||
|
Reference in New Issue
Block a user