我有一个表格,其中载有从一个表中检索的数据。 我在每一行的末尾都附有一个ed子。 ed子允许用户编辑某一项目的信息。 我希望ed子能够让用户了解所附信息。 例如:
--------------------------
NAME | AGE | GENDER |
--------------------------
A | 4 | Female |EDIT
--------------------------
B | 9 | Female |EDIT
--------------------------
C | 2 | Male |EDIT
--------------------------
If I click the EDIT button on A s row, it would allow me to edit A s information. Please help.
<form id="edit" name="edit" method="post" action="edititem.php">
<table width="792" border= 1 align= center cellpadding= 0 cellspacing= 0 id= usertable >
<tr bgcolor=#706C4B style= color:black >
<td width="16%" align= center id="box_header2" style= width:10% >Item Name</td>
<td width="16%" align= center id="box_header2" style= width:10% >Item Quantity</td>
<td width="14%" align= center id="box_header2" style= width:13% >Storage Capacity</td>
<td width="13%" align= center id="box_header2" style= width:11% >Brand</td>
<td width="13%" align= center id="box_header2" style= width:11% >Color</td>
<td width="13%" align= center id="box_header2" style= width:12% >MAC Address</td>
<td width="13%" align= center id="box_header2" style= width:12% >S/N Number</td>
<td width="13%" align= center id="box_header2" style= width:12% ></td>
</tr>
<?php
$sql="select * from item";
$result=mysql_query($sql);
while ($row=mysql_fetch_array($result))
{
?>
<tr bgcolor=#cfccb7 style= color:black >
<td><div align="center"><?php echo $row[ item_name ]?></div></td>
<td><div align="center"><?php echo $row[ item_quantity ]?></div></td>
<td><div align="center"><?php echo $row[ item_capacity ]?></div></td>
<td><div align="center"><?php echo $row[ item_brand ]?></div></td>
<td><div align="center"><?php echo $row[ item_color ]?></div></td>
<td><div align="center"><?php echo $row[ item_mac ]?></div></td>
<td><div align="center"><?php echo $row[ item_sn ]?></div></td>
<td><div align="center"><input type="submit" name="button" id="button" value="Edit" /></div></td>
</tr>
<?php
}
?>
</table>
</form>