diff --git a/classes/pg_DBConnector.class.php b/classes/pg_DBConnector.class.php index c70e52e..2550de9 100644 --- a/classes/pg_DBConnector.class.php +++ b/classes/pg_DBConnector.class.php @@ -38,10 +38,10 @@ class DBConnector return self::$handlers[$handler_name]; } - if (!$handler = pg_connect("host='".$db_settings['host']."' dbname='".$db_settings['database']."' user='".$db_settings['user'].'" password="'.$db_settings['password']."'")) { - throw new MJException('Can\'t connect to DB '.pg_last_error($handler), 2); + if (!$handler = pg_connect("host='".$db_settings['host']."' dbname='".$db_settings['database']."' user='".$db_settings['user']."' password='".$db_settings['password']."'")) { + throw new MJException('Can\'t connect to DB '.pg_last_error(), 2); } - + return self::$handlers[$handler_name] = $handler; }