I\'m using PDO to get data off a MySQL server. What I noticed is this: if the MySQL server is unavailable, it takes really (relatively) long for this code to return
$DBH = new PDO( "mysql:host=$host;dbname=$dbname", $username, $password, array( PDO::ATTR_TIMEOUT => 5, // in seconds PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ) );