Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head><title>belajarPHP</title>
- </head>
- <body>
- <?php
- $pemakai = "php";
- $password = "007php";
- $id_mysql = mysql_connect("localhost", $pemakai, $password);
- if (! $id_mysql)
- die ("gagal melakukan koneksi silahkan di cek kembali pengaturan database");
- if (! mysql_select_db("bukulmt", $id_mysql))
- die ("database tidak bisa di pilih");
- $hasil = mysql_query("SELECT * FROM daftar", $id_mysql);
- if(! $hasil)
- die("permintaan gagal dilaksanakan");
- $jum_kolom = mysql_num_fields($hasil);
- $jum_baris = mysql_num_rows($hasil);
- print("Jumlah Kolom : $jum_kolom <BR>dan jumlah baris $jum_baris <BR>\n");
- mysql_close($id_mysql);
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment