Advertisement
ridyko

konkeksi.php ( Data Siswa )

Feb 3rd, 2022
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1. <?php
  2.  $host = "localhost";
  3.  $dbname = "dbquest";
  4.  $username = "root";
  5.  $password = "";
  6.  try {
  7.  $db = new PDO("mysql:host={$host};dbname={$dbname}", $username, $password);
  8.  $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  9.  } catch (PDOException $exception){
  10.  die("Connection error: " . $exception->getMessage());
  11.  }
  12. ?>
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement