【发布时间】:2013-11-20 22:22:19
【问题描述】:
我正在尝试更新我能够查看的值。它似乎没有错误,但似乎也没有任何更新。谁能帮我确定它没有更新的地方?请
<?php
// check for errors
ini_set('display_errors', 1);
//calls connection
require_once('connection.php');
//view first table
$ResultSets = getResults("members");
echo "<table border='1' cellpadding='6'>";
echo "<tr> <th>member_id</th> <th>first_name</th> <th>second_name</th> <th>Email</th> ";
foreach ($ResultSets as $record) {
echo "<form action=index.php method=post>";
echo "<tr>";
echo "<td>" . "<input type=text name=topic value =" . $record ['member_id'] . " </td>";
echo "<td>" . "<input type=text name=topic value =" . $record ['first_name'] . " </td>";
echo "<td>" . "<input type=text name=topic value =" . $record ['second_name'] . " </td>";
echo "<td>" . "<input type=text name=topic value =" . $record ['email'] . " </td>";
echo "<td>" . "<input type=hidden name=hidden value =" . $record ['member_id'] . " </td>";
//echo "</tr>";
echo "<input type=submit name=update value=Update>" . " </td>";
}
echo "<table>";
echo "</form>";
if (isset($_POST['update'])) {
$updateQuery = "UPDATE members SET first_name='$_POST[first_name]', second_name='$_POST[second_name]', email='$_POST[email]' WHERE member_id='$_POST[hidden]'";
mysql_query($updateQuery);
}
?>
【问题讨论】:
-
您确定要更新
$_POST['update']的设置时间吗?