Guest User

Untitled

a guest
Sep 6th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. <?php
  2. session_start();
  3. $host = "localhost";
  4. $user = "root";
  5. $pass = '';
  6. $db = "xxxxxx";
  7. try {
  8. $conn = new PDO("mysql:host=$host;dbname=$db", $user, $pass);
  9. $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  10. }
  11. catch(PDOException $e)
  12. {
  13. echo "Connection failed: " . $e->getMessage();
  14. }
  15. ?>
Add Comment
Please, Sign In to add comment