📜  php new PDO timeout - PHP 代码示例

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

代码示例1
$DBH = new PDO(
    "mysql:host=$host;dbname=$dbname", 
    $username, 
    $password,
    array(
        PDO::ATTR_TIMEOUT => 5, // in seconds
        PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
    )
);