Advertisement
Guest User

Untitled

a guest
Oct 14th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. <?php
  2.  
  3. $dsn="mysql:host=localhost;dbname=restaurant";
  4. $db_username="root";
  5. $db_password="hscc";
  6.  
  7. try {
  8. $db= new PDO($dsn, $db_username, $db_password);
  9. } catch (PDOException $e) {
  10. echo "<h1>There was an error connecting to the database.</h1><br/>";
  11. echo "<h2>Error: " . $e->getMessage() . "</h2>";
  12. exit();
  13. }
  14.  
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement