Advertisement
Guest User

Untitled

a guest
Dec 15th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <?php
  2. $servername = "mysqxxxx.premium";
  3. $username = "exxxntaxxx11";
  4. $password = "xxxxxx";
  5.  
  6. try {
  7. $conn = new PDO("mysql:host=$servername;dbname=exxxntaxxx11;charset=utf8", $username, $password);
  8. // set the PDO error mode to exception
  9. $conn->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
  10. $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  11. echo "Connected successfully";
  12. }
  13. catch(PDOException $e)
  14. {
  15. echo "Connection failed: " . $e->getMessage();
  16. $conn = null;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement