Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class database{
- // properti
- private $dbHost;
- private $dbUser;
- private $dbPass;
- private $dbName;
- public $mysqli;
- function __construct(){
- $this->dbHost="localhost";
- $this->dbUser="root";
- $this->dbPass="12345";
- $this->dbName="perpustakaan";
- $this->mysqli = new mysqli($this->dbHost, $this->dbUser, $this->dbPass, $this->dbName);
- /* check connection */
- if (mysqli_connect_errno()) {
- printf("Connect failed: %s\n", mysqli_connect_error());
- exit();
- }
- else {//echo "Koneksi Berhasil";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement