0
我在構造函數中的下列PDO初始化設置了PDO包裝:PDO包裝返回NULL
public function __construct($engine, $host, $username, $password, $dbName)
{
$this->host = $host;
$this->dsn = $engine.':dbname='.$dbName.';host='.$host;
$this->dbh = parent::__construct($this->dsn, $username, $password);
$this->dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
}
我的主要問題是,當我設置胸徑初始化爲在構造函數中父,它返回NULL
。
並且產生連鎖反應。
有什麼具體的,我做錯了嗎?
啊,是的。非常感謝你。 – zeboidlund