Membuat tabel otomatis dengan memanggil database
ini kodenya:
<?php>
$query = "SELECT * FROM absen";
$database = mysql_connect("localhost","root","2610");
mysql_select_db("guru", $database);
$result = mysql_query($query, $database);
echo "<table border='1'>";
for($i=0; $row = mysql_fetch_row($result); $i++){
echo "<tr><td>$row[0]</td> <td>$row[1]</td> <td>$row[2]</td></tr>";}
echo "</table>";
?>
<?php>
$query = "SELECT * FROM absen";
$database = mysql_connect("localhost","root","2610");
mysql_select_db("guru", $database);
$result = mysql_query($query, $database);
echo "<table border='1'>";
for($i=0; $row = mysql_fetch_row($result); $i++){
echo "<tr><td>$row[0]</td> <td>$row[1]</td> <td>$row[2]</td></tr>";}
echo "</table>";
?>
Silahkan isi Komentar Anda