Advertisement
Guest User

koneksi

a guest
Oct 10th, 2018
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  1. <?php
  2.     try {
  3.         $host = "localhost";
  4.         $username = "root";
  5.         $password = "";
  6.         $dbname = "db_sensor";
  7.  
  8.         $PDO = new PDO("mysql:host=" . $host . ";dbname=" . $dbname . ";charset=utf8", $username, $password);
  9.     } catch (PDOException $erro) {
  10.         echo "Gagal Terhubung ke database : " . $erro->getMessage();
  11.     }
  12.  
  13. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement