我为一些客户创建了一个支持表单,他们向它提交信息,我在我创建的面板中看到它。在此面板中,我希望能够选中记录旁边的框并单击更新按钮,它将使用时间戳更新该记录,显示我已完成工作以及何时完成。这是示例代码
echo "<table border='1'>
<tr>
<th>ICL</th>
<th>PAGE ID</th>
<th>SUBMISSION NAME</th>
<th>UPTDATES/BUGS</th>
<th>MISSING INFO</th>
<th>TIME OF SUBMISSION</th>
<th>COMPLETED</th>
<th>TIME COMPLETED</th>
</tr>";
echo "<form name='completed' action='insert4panel.php' method='post'>";
while($row = mysql_fetch_array($results))
{
echo "<tr>";
echo "<td>" . $row['ICL'] . "</td>";
echo "<td>" . $row['officename'] . "</td>";
echo "<td>" . $row['submitname'] . "</td>";
echo "<td>" . $row['feedback'] . "</td>";
echo "<td>" . $row['missinginfo'] . "</td>";
echo "<td>" . $row['TimeStamp'] . "</td>";
echo "<td><input type='checkbox' name='complete'></td>";
echo "<td>" . $row['completionstamp'] . "</td>";
echo "</tr>";
}
echo "<input type='submit' value='Update'>";
echo "</form>";
echo "</table>";
当我点击提交时会发生什么我将它发送到这个代码
$timeissued=$_POST["complete"];
$date = date("m-d-y H:i:s");
mysql_query("INSERT INTO SITES (completed, completetime )
VALUES ('$timeissued' ,'$date')");
我知道我没有告诉它我要向哪个记录添加时间戳或复选框,所以它不会这样做,但是它会创建一个带有时间戳的新记录并不会保存复选框并且将其余字段留空。我确定答案很简单