Advertisement
Guest User

Untitled

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