📜  设置 PDO - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:50.284000             🧑  作者: Mango

代码示例1
$dbConnection = new PDO('mysql:dbname=dbtest;host=127.0.0.1;charset=utf8', 'user', 'password');

$dbConnection->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$dbConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);