Advertisement
Guest User

Untitled

a guest
Feb 8th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. $servername = 'localhost';
  2. $username = "root";
  3. $password = "rRc32_2qP";
  4. $database = 'driver';
  5.  
  6. try{
  7. $conn = new PDO("mysql:host=localhost;dbname=driver", $username, $password);
  8. // set the PDO error mode to exception
  9. $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  10. echo "Connected successfully";
  11. }
  12. catch(PDOException $e)
  13. {
  14. echo "Connection failed: " . $e->getMessage();
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement