SHARE
TWEET

Untitled

a guest Jun 15th, 2017 114 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $servername = "localhost";
  4. $username = "username";
  5. $password = "password";
  6.  
  7. try {
  8.     $conn = new PDO("mysql:host=$servername;dbname=myDB", $username, $password);
  9.     // set the PDO error mode to exception
  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.     }
  17. ?>
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