daily pastebin goal
27%
SHARE
TWEET

Erik2

a guest Dec 6th, 2016 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $servername = "localhost";
  2. $username = "root";
  3. $password = "";
  4.  
  5. try {
  6.     $conn = new PDO("mysql:host=$servername;dbname=php_contact", $username, $password);
  7.     // set the PDO error mode to exception
  8.     $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  9.     // echo "Connected successfully \n";
  10.     }
  11. catch(PDOException $e)
  12.     {
  13.     echo "Connection failed: " . $e->getMessage();
  14.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top