$hostname_MYDB = "192.168.0.5";
$database_MYDB = "mydb";
$username_MYDB = "root";
$password_MYDB = "test";
try {
$MYDBPDO = new PDO("mysql:host=".$hostname_MYDB.";dbname=".$database_MYDB, $username_MYDB, $password_MYDB);
$MYDBPDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$MYDBPDO->setAttribute(PDO::ATTR_TIMEOUT, 1);
} catch (PDOException $ex) {
echo "unable to connect to mysql server";
}
I run this with mysql server shut-down but it doesn't seem to work, the page keeps loading ( trying to connect ).
the mysql server is running on windows if that makes a difference, php too.