/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$hostname = 'localhost'; $username = 'username'; $password = 'password'; try { $dbh = new PDO("mysql:host=$hostname;dbname=mysql", $username, $password); } catch(PDOException $e) { echo $e->getMessage(); }