function connect() { $databasePDO = $this->configValues->getValue('SQLValues', 'databasePDO'); $databaseUser = $this->configValues->getValue('SQLValues', 'databaseUser'); $databasePassword = $this->configValues->getValue('SQLValues', 'databasePassword'); try { self::$database = new PDO($databasePDO, $databaseUser, $databasePassword); if (!self::$database->query("SELECT * FROM `aptitude`")) { throw new PDOException('Aptitude table in Database is empty! Database connection Error?'); } } catch (PDOException $e) { error_log('Database connection failed: '); error_log(' ' . $databasePDO); error_log(' ' . $e->getMessage()); error_log(' Current Dir: ' . getcwd()); } }