Advertisement
Guest User

Untitled

a guest
Sep 29th, 2017
70
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.  
  3. $db_host="localhost";
  4. $db_user="root";
  5. $db_name="siswa";
  6. $db_pass="";
  7.  
  8. try {
  9. $db = new PDO("mysql:host={$db_host};dbname={$db_name}",$db_user,$db_pass);
  10. $db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);
  11. } catch (PDOException $e) {
  12. echo $e->getMessage();
  13. }
  14.  
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement