Guest User

Untitled

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