Skip to content

Instantly share code, notes, and snippets.

@ombak
Last active May 29, 2020 15:14
Show Gist options
  • Save ombak/cf2d6e124d1e9322d5ffd221b2fd8a24 to your computer and use it in GitHub Desktop.
Save ombak/cf2d6e124d1e9322d5ffd221b2fd8a24 to your computer and use it in GitHub Desktop.

Revisions

  1. ombak renamed this gist May 29, 2020. 1 changed file with 0 additions and 0 deletions.
  2. ombak created this gist May 29, 2020.
    10 changes: 10 additions & 0 deletions menghubungkan_php_dng_mysql.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    <?php
    //...kosongkan parameter password bila tidak ada password
    $conn = mysql_connect("localhost", "root", "");

    //...bila koneksi gagal
    if(!$conn) {
    die("koneksi gagal, periksa lagi parameter.");
    } else {
    echo "koneksi berhasil.";
    }