I can't find an answer to this anywhere. Maybe its really simple
I have my mysql PDO connection like this:
try{
$DBH = new PDO("mysql:host=$db_hostname;dbname=$db_database", $db_username, $db_password);
$DBH->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
}
catch (PDOException $e){
echo $e->getMessage();
exit;
}
i want to just test if the connection worked, ie. if the password, username, databasename & hostname were spelled correctly.
the try, throw just seems to pick up fundamental errors, like if the driver is spelt wrong. it doesnt throw an error if say the password is wrong.
thanks