script koneksi php ke database mysql:
===================================================================
$conn = mysql_connect("localhost", "root", "");
if ($conn){ // => sama dengan if ($conn == true)
echo "Koneksi ke Server sukses
";
";
} else {
echo "Koneksi ke Server Gagal
";
";
exit; // => program tidak akan mengeksekusi code berikutnya (keluar)
}
$select_db = mysql_select_db("psi_rawat_inap");
if ($select_db){
echo "Memilih database sukses
";
";
} else {
echo "Memilih database Gagal
";
";
exit;
}
=============================================================
0 testimonial:
Post a Comment