Mengambil Data dari MySQL

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

Please like & share:

About

> Governance Officer > Blogger from Semarang, Indonesia > (Pingin Jadi) Writer > Lecturer

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *