0

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(); } ?>
treyBake
  • 6,277
  • 6
  • 25
  • 54
waqas
  • 39
  • 6

0 Answers0