Berikut ini adalah source code untuk menampilkan data mahasiswa tersebut. Saya beri nama lihat.php.
<html>
<body>
<table border='1' align='center'>
<tr><th>No</th><th>NRP</th><th>Nama</th><th>Jurusan</th><th>Kelamin</th><th>Alamat</th></tr>
<?php
include 'koneksi.php';
$query = "SELECT * FROM data_mhs ";
$exe = mysql_query($query);
$no = 1;
while($row = mysql_fetch_assoc($exe)){
$a = $row['nrp'];
$b = $row['nama'];
$c = $row['jurusan'];
$d = $row['kelamin'];
$e = $row['alamat'];
echo "<tr><td>$no</td><td>$a</td><td>$b</td><td>$c</td><td>$d</td><td>$e</td></tr>";
$no++;
}
?>
</table>
</body>
</html>
<body>
<table border='1' align='center'>
<tr><th>No</th><th>NRP</th><th>Nama</th><th>Jurusan</th><th>Kelamin</th><th>Alamat</th></tr>
<?php
include 'koneksi.php';
$query = "SELECT * FROM data_mhs ";
$exe = mysql_query($query);
$no = 1;
while($row = mysql_fetch_assoc($exe)){
$a = $row['nrp'];
$b = $row['nama'];
$c = $row['jurusan'];
$d = $row['kelamin'];
$e = $row['alamat'];
echo "<tr><td>$no</td><td>$a</td><td>$b</td><td>$c</td><td>$d</td><td>$e</td></tr>";
$no++;
}
?>
</table>
</body>
</html>
Demikian postingan dari saya, semoga bermanfaat bagi teman-teman.
Selamat Mencoba Dan Semoga Bermanfaat
0 comments:
Post a Comment