我一直在寻找我的问题的答案,但我找不到一个,
我正在从 db 检索数据以输入字段,并再次将输入字段中更改的值更新到 db。
这是我的代码
echo "<table>";
while ($row = mysql_fetch_array($result)){
echo "<form method=\"GET\" action=\" ".htmlspecialchars($_SERVER['PHP_SELF'])."\" > ";
echo "<tr><td>ID:</td><td>Company Name</td><td>Date for Service</td><td>Edit</td><td>Delete</td></tr>";
echo "<td><input type= 'text' name = 'jobrequestnumber' value =".$row['jobrequestnumber']."></td>" ; // results in the same jobrequestnumbers
echo "<td><input type= 'text' name = 'requestingcompany' value =".$row['requestingcompany']."></td>" ;//this too
echo "<td><input type= 'date' name = 'dateforService' value =".$row['dateforService']."></td>" ;// this one also
echo "<td><a href='delete.php?jobrequestnumber=".$row['jobrequestnumber']."'>Delete</a></td>"; //too
echo "</form> ";
echo "<td><a href=\"update_request.php?jobrequestnumber='jobrequestnumber'&requestingcompany='requestingcompany'&dateforService='dateforService'\">Update</a></td>";
echo "</tr>";
}
echo "</table>";
在链接中,我试图通过引用输入字段的名称来传递值,但它不起作用。!
会有其他方法或有人可以解决这个问题吗?
非常感谢。