Assalamualaikum wr.wb. Welcome To My Blog Copyright @rhandiki.com

Coding Web Programing Dasar

<html>
<head>
<title>Tabel Data Anggota</title>
</head>
<body>
                        <table width="438"
                                    border="1">
<tr
<td colspan="4" bgcolor="#990099"><div
align="center"><strong>TAMPIL DATA ANGGOTA</strong></div></td>
</tr
<tr
<td width="51" bgcolor="#FFFFFF">
<div align="center"><strong>ID</strong></div></td>
<td width="123" bgcolor="#FFFFFF">
<div align="center"><strong>Nama</strong></div></td>
<td width="162" bgcolor="#FFFFFF">
<div align="center"><strong>Alamat</strong></div></td>
<td width="74" bgcolor="#FFFFFF">
<div align="center"><strong>Kelamin</strong></div></td>
</tr
>                                 
            <?php
            $koneksi=mysql_connect("localhost","root","P@ssw0rd")or die ("Koneksi gagal".mysql_error());
            if($koneksi){
            mysql_select_db("buku",$koneksi)or die("Database gagal dibuka".mysql_error());
           
           
            $sql=mysql_query("SELECT*FROM anggota",$koneksi)or die("Query Gagal".mysql_error());
            while($data=mysql_fetch_array($sql)){
            ?>
           
    <tr>
            <td><?php echo $data['id_anggota'];?></td>
            <td><?php echo $data['nm_anggota'];?></td>
            <td><?php echo $data['alamat'];?></td>
            <td><?php echo $data['kelamin'];?></td>
            <td align="center">       </td>
            </tr>
            <?php}}
            ?>

Tidak ada komentar:

Poskan Komentar