rangga_hrdme

connect.php

Dec 1st, 2021
787
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5.     <meta charset="UTF-8">
  6.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8.     <title>Document</title>
  9. </head>
  10.  
  11. <body>
  12.     <?php
  13.  
  14.     $server = 'localhost';
  15.     $user = 'rangga';
  16.     $pass = 'rangga';
  17.     $db = 'contoh';
  18.     $koneksi = mysqli_connect($server, $user, $pass, $db) or die(mysqli_error($koneksi));
  19.  
  20.     if ($koneksi) {
  21.         echo "Koneksi ke database berhasil <br>";
  22.     } else {
  23.         "Koneksi: gagal <br>";
  24.     }
  25.     ?>
  26. </body>
  27.  
  28. </html>
RAW Paste Data