Guest User

Untitled

a guest
Feb 16th, 2018
155
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. $username = "root";
  4. $password = "";
  5. $db = "latihan";
  6.  
  7. try{
  8. $conn = new PDO("mysql:host=$host;dbname=$db",$username, $password);
  9. $conn->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
  10. }
  11. catch(PDOException $e){
  12. echo "Connection failed: ".$e->getMessage();
  13. }
  14. ?>
Add Comment
Please, Sign In to add comment