Skip to content

Instantly share code, notes, and snippets.

@wichaksono
Created January 15, 2018 00:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wichaksono/8a3d839295b23f2974d814ba28277dd3 to your computer and use it in GitHub Desktop.
Save wichaksono/8a3d839295b23f2974d814ba28277dd3 to your computer and use it in GitHub Desktop.
<?php
define('DBHOST', 'localhost');
define('DBUSER', 'root');
define('DBPASS', '');
define('DBNAME', 'bootstrap');
/**
* $dbconnect : koneksi kedatabase
*/
$dbconnect = new mysqli(DBHOST, DBUSER, DBPASS, DBNAME);
/**
* Check Error yang terjadi saat koneksi
* jika terdapat error maka die() // stop dan tampilkan error
*/
if ($dbconnect->connect_error) {
die('Database Not Connect. Error : ' . $dbconnect->connect_error);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment