From d3369384d15e13dba937fa89dabc273e3ca672e8 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Tue, 23 Aug 2016 18:18:05 -0700 Subject: include port in pdo url when host is 'localhost' --- include/dba/dba_driver.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/dba') diff --git a/include/dba/dba_driver.php b/include/dba/dba_driver.php index f6091f6e1..7225a9be2 100755 --- a/include/dba/dba_driver.php +++ b/include/dba/dba_driver.php @@ -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; -- cgit v1.2.3