我遇到了一个关于更新名为“answers”的数据库表中的值的问题。因为它没有更新表。所以,这是我的代码:
if(isset($_POST['marked']))
{ $marked= $_POST['marked'];
$command= "UPDATE Answers SET " .
"SessionID=" . $_POST['SessionID'] . ", " .
"TestID=" . $_POST['TestID'] . ", " .
"QuesID=" . $_POST['QuesID'] . ", " .
"A1=0, " .
"A2=0, " .
"A3=0, " .
"A4=0, " .
"A5=0, " .
"A6=0, " .
"AnswerText=\"\", " .
"SortOrder='" . intval($_POST['Order']) . "' " .
"marked=1".
"WHERE SessionID=" . $_POST['SessionID'] .
" AND QuesID=" . $_POST['QuesID'];
$lolsql= mysql_query($command, $conn);
}
每当有人单击标记(提交按钮)时,我想将具有 0 值的“标记”字段更新为 1。请有人帮助我。提前致谢:)