Advertisement
Guest User

SeansBonfireCode

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