01.
<?php
02.
ini_set
(
'display_errors'
, 1);
03.
error_reporting
(~0);
04.
05.
$serverName
=
"localhost"
;
06.
$userName
=
"root"
;
07.
$userPassword
=
"1234567890"
;
08.
$dbName
=
"projectx"
;
09.
10.
$conn
= mysqli_connect(
$serverName
,
$userName
,
$userPassword
,
$dbName
);
11.
12.
$sql
=
"SELECT * FROM material"
;
13.
14.
$query
= mysqli_query(
$conn
,
$sql
);
15.
?>
16.
<table
class
=
"table table-bordered"
>
17.
<thead>
18.
<tr>
19.
<th scope=
"col"
> เลขวัสดุ</div></th>
20.
<th scope=
"col"
>ชื่อ</div></th>
21.
<th scope=
"col"
>จำนวนคงเหลือ</div></th>
22.
<th scope=
"col"
>จำนวนนับ</div></th>
23.
<th scope=
"col"
>ผลต่าง</div></th>
24.
<th scope=
"col"
>แก้ไข</div></th>
25.
</tr>
26.
</thead>
27.
<?php
28.
while
(
$result
=mysqli_fetch_array(
$query
,MYSQLI_ASSOC))
29.
{
30.
?>
31.
<tr>
32.
<td><?php
echo
$result
[
"Material_id"
];?></div></td>
33.
<td><?php
echo
$result
[
"Material_name"
];?></td>
34.
<td><?php
echo
$result
[
"Material_qty"
];?></td>
35.
<td><?php
echo
$result
[
"Material_Count"
];?></div></td>
36.
<td><?php
echo
$result
[
"Material_diff"
];?></td>
37.
<td><a href=
"edit.php?Material_id=<?php echo $result["
Material_id
"];?>"
>Edit</a></td>
38.
</tr>
39.
<?php