01.
<?php
02.
include
'connect.php'
;
03.
$sql
=
"select * from items where itemname like '%{$_POST['itemname']}%'"
;
04.
$query
= mysql_query(
$sql
);
05.
?>
06.
<div
class
=
"col-md-12"
>
07.
<table
class
=
"table table-bordered"
>
08.
<thead>
09.
<tr>
10.
<th>ลำดับ</th>
11.
<th>รหัสสินค้า</th>
12.
<th>ชื่อสินค้า</th>
13.
<th>ราคาสินค้า</th>
14.
<th>หน่วยนับ</th>
15.
</tr>
16.
</thead>
17.
<tbody>
18.
<?php
$i
=1;
while
(
$result
= mysql_fetch_assoc(
$query
)) { ?>
19.
<tr>
20.
<td><?php
echo
$i
;?></td>
21.
<td><?php
echo
$result
[
'codename'
];?></td>
22.
<td><?php
echo
$result
[
'itemname'
];?></td>
23.
<td><?php
echo
number_format(
$result
[
'price'
]);?></td>
24.
<td><?php
echo
$result
[
'unit'
];?></td>
25.
</tr>
26.
<?php
$i
++; } ?>
27.
</tbody>
28.
</table>
29.
</div>