Mau nanya nih..
Cara menampilkan hasil pencarian dari koding berikut ini gimana ya..?
Makasih..
<?php
require_once("libs/controller/Barang.php");
$barang = new Barang();
?>
<table cellpadding="0" cellspacing="1" border="0" width="100%">
<tr>
<th width="70">Kode Barang</th>
<th width="200">Nama Barang</th>
<th width="30">Harga Beli</th>
<th width="30">Harga Jual</th>
<th width="30">Stok Minimal</th>
<th width="50">Edit</th>
<th width="50">Hapus</th>
</tr>
<?php
echo "<div style='border-left: 20px solid #bebebe; background-color: #8afa8f; margin-top: 5px; padding: 3px; width:280px; height: auto; text-align: left;-moz-border-radius: 0px 20px 20px 0px ;'>
<form method=POST action='hasil-pencarian.php'>
<input class=text name=kata type=text size=17 />
<input type=submit value=Cari />
</form></div>";
$result = $barang->showAll();
while($row = $result->fetch_assoc()){
echo "<tr>";
echo "<td>$row[kd_barang]</td>";
echo "<td>$row[namabarang]</td>";
echo "<td>$row[hargabeli]</td>";
echo "<td>$row[hargajual]</td>";
echo "<td>$row[stokmin]</td>";
echo "<td class='act'><a href='index.php?page=prod&idbarang=$row[id_barang]&kd_barang=$row[kd_barang]&namabarang=$row[namabarang]&hargabeli=$row[hargabeli]&hargajual=$row[hargajual]&stokmin=$row[stokmin]'><img border='0' src='images/edit.png'></a></td>";
echo "<td class='act'><a href='index.php?page=prod&action=delete&kd_barang=$row[kd_barang]'><img border='0' src='images/hapus.png'></a></td>";
echo "</tr>";
}
?>
</table>