I used the following code.
<? php
$dsn = "mysql:host=localhost;dbname=asys";
$username = "root";
$password = "";
try {
$db = new PDO ($dsn, $username, $password);
echo "connected";
} catch (PDOException $e) {
$error_message = $e->getMessage();
echo $error_message;
exit();
}
?>
but at the output I get this error message when i run it on my localhost
getMessage(); echo $error_message; exit(); } ?>