Created
May 29, 2020 15:15
-
-
Save ombak/bcd59dbb8aed07e3a9eff8d2c1f3927d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//...kosongkan parameter password bila tidak ada password | |
$conn = mysql_connect("localhost", "root", ""); | |
//...bila koneksi gagal | |
if(!$conn) { | |
die("koneksi gagal, periksa lagi parameter."); | |
} | |
//...mysql_error() untuk menampilkan pesan error | |
//...dari koneksi ke database | |
$db_select = mysql_select_db("database", $conn); | |
if(!$db_select) { | |
die("database tidak terhubung: " . mysql_error()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment