/** * PDO database connection starts * return database connection instance */ public function connect() { // One connection through whole application if (null == self::$cont) { try { self::$cont = new PDO("mysql:host=" . self::$dbHost . ";" . "dbname=" . self::$dbName, self::$dbUsername, self::$dbUserPassword); } catch (PDOException $e) { die($e->getMessage()); } } return self::$cont; }