Last active
May 31, 2019 01:12
-
-
Save masirfani/f6b9dc7f89dde64194fdfdd1fa9ea179 to your computer and use it in GitHub Desktop.
Penghubung kamu(project) dan dia(database)
This file contains 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 | |
$host = mysqli_connect('localhost','root','','belajar'); | |
//$host = untuk variable penampung koneksi | |
//mysqli_connect = perintah untuk menghubungkan dengan database | |
//localhost = server lokal/server komputer kita | |
//root = user tertinggi dalam xampp | |
//bagian yang kosong = password xampp | |
//belajar = nama database yang akan kita hubungkan | |
if (!$host) { | |
//jika file koneksi bernilai salah lakukan ini | |
echo "koneksi error"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment