<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<h1 align='center'>
Tabel Barang
</h1>
<?php
//create the connection and select the DB
$link =mysql_connect("localhost","root","123");
if ($link) {
mysql_selectdb("inventory",$link);
//select record from DB
$query ="select* from barang";
$result=mysql_query($query);
//display record from the table
echo "<table border='1' : height='20' : bordercolor='#FF0000' : align='center'>";
echo "<tr><th>Kode Barang</th><th>Nama Barang</th><th>Harga Beli</th><th>Harga Jual</th><th>Stok</th><th>Satuan</th>";
//looping
while ($row=mysql_fetch_array($result, MYSQL_NUM)) {
echo "<tr><td>$row[0]</td><td>$row[1]</td><td>$row[2]</td><td>$row[3]</td><td>$row[4]</td><td>$row[5]</td></tr>";
}
echo "</table>";
} else {
echo "can't connect to the database!";
}
?>
<form action="insert.php" name="insert" method="post" style="text-align:center">
<tr><td></td><td width="2"></td><td><input type="submit" value="insert"/></td></tr>
</form>
</body>
</html>
<Pembahasan Tentang Inventory>
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar