Mengambil data dari MySQL dengan PHP

 on Wednesday, December 26, 2012  


<?php
mysql_connect("localhost", "admin", "admin999") or die(mysql_error());
mysql_select_db("coba1") or die(mysql_error());
$hasil = mysql_query("SELECT * FROM tabelku")
or die(mysql_error());
while ($record = mysql_fetch_array($hasil)){
echo "NIM: ".$record['nim']. "< br >";
echo "Nama: ".$record['nama']. "< br >";
echo "Alamat: ".$record['alamat']. "< br >";
echo "No KTP: ".$record['noktp']. "< br >< br >"; }
?>

dimana :
host --> localhost
userid --> admin
passwd --> admin999
db --> coba1
tabel --> tabelku

Mengambil data dari MySQL dengan PHP 4.5 5 Agustinus Darto Iwan Setiawan Wednesday, December 26, 2012 <?php mysql_connect("localhost", "admin", "admin999") or die(mysql_error()); mysql_select_db("coba1&...


No comments:

Post a Comment

Silakan berkomentar ....