PDO Connection Test

前端 未结 4 1037
难免孤独
难免孤独 2020-11-27 07:04

I am writing an installer for one of my apps and I would like to be able to test some default database settings.

Is this possible using PDO to test valid and invalid

4条回答
  •  一生所求
    2020-11-27 07:26

    There's a missing closing parenthese at the end of PDO::ERRMODE_EXCEPTION.

    Should be:

    $this->pdo = new PDO($cfg['DB'], $cfg['DB_USER'], $cfg['DB_PASS'],
        array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
    

提交回复
热议问题