我正在尝试从数据库中检索记录并将它们放入表中。我想要一个可以做一些处理的更新按钮。这是代码。它正确输出。但是更新按钮(图像)不起作用。请帮忙
<?php
echo "</br>";
echo "<table border='1'>
<tr>
<th>Order ID</th>
<th>Customer Number</th>
<th>Order Items</th>
<th>Transaction Time</th>
<th>Amount</th>
</tr>";
$con = mysql_connect('localhost', 'root', '');
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("kaka", $con);
$sql="SELECT * FROM orders WHERE status = 'NRDY'";
$result2 = mysql_query($sql);
while($row1 = mysql_fetch_array($result2))
{
echo "<div class=\"update\"><form method='post' action=\"test.php\">\n";
echo "<tr>";
echo "<td><input type='hidden' name='order_id' value='".$row1['order_id']."'>" .$row1['order_id']. "</td>";
echo "<td><input type='hidden' name='cust_num' value='".$row1['cust_num']."'>" .$row1['cust_num']. "</td>";
echo "<td><input type='hidden' name='items' value='".$row1['items']."'>" .$row1['items']. "</td>";
echo "<td><input type='hidden' name='order_time' value='".$row1['order_time']."'>" .$row1['order_time']. "</td>";
echo "<td><input type='hidden' name='order_id' value='".$row1['amount']."'>" .$row1['amount']. "</td>";
//echo "<td>" . $row1['order_id'] . "</td>";
//echo "<td>" . $row1['cust_num'] . "</td>";
//echo "<td>" . $row1['items'] . "</td>";
//echo "<td>" . $row1['order_time'] . "</td>";
//echo "<td>" . $row1['amount'] . "</td>";
echo "<td>" . "<input type=\"image\" src=\"images/update.png\" alt=\"Update Row\" class=\"update\" title=\"Update Row\">\n" . "</td>";
echo "</tr>";
echo "</form></div>";
}
echo "</table>";
?>
这是test.php
<?php
echo $_POST['order_id'];
?>