Advertisement
zza_ibliizt

coba-koneksi-ke-database.php

Dec 20th, 2018
1,921
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username   = "(Username agan!)";
  4. $password   = "(Password agan!)";
  5. $database   = "(Database agan!)";
  6.  
  7. $conn = mysqli_connect($servername, $username, $password, $database);
  8.  
  9.     // Check Koneksi ke database
  10.     if (!$conn) {
  11.         die("Koneksi gagal disini: " . mysqli_connect_error());
  12.     }
  13.     echo "Koneksi Berhasil Gan!";
  14.         mysqli_close($conn);
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement