SHARE
TWEET

conn.php

a guest Jun 8th, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php  
  2.     // Konfigurasi database anda
  3.     $host = "localhost";
  4.     $dbname = "dbLogin";
  5.     $username = "root";
  6.     $password = "root";
  7.  
  8.     try {
  9.         // Buat Object PDO baru dan simpan ke variable $db
  10.         $db = new PDO("mysql:host={$host};dbname={$dbname}", $username, $password);
  11.         // Mengatur Error Mode di PDO untuk segera menampilkan exception ketika ada kesalahan
  12.         $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  13.     } catch (PDOException $exception){
  14.         die("Connection error: " . $exception->getMessage());
  15.     }
  16. ?>
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