我确定我现在在页面上获得$bn
和$answer
的值我只想在列回答值$answer
中插入值其中qid是$bn
。
<?php
$answer = $_POST['one'];
$an = $_POST['two'];
$bn = $an - 1;
echo "$bn";
$con = mysql_connect('localhost', 'root', 'pankaj') or die(mysql_error());
$db = mysql_select_db('quiz', $con) or die(mysql_error());
$q = "INSERT INTO question(uanswer) VALUE '" . $answer . "' where qid='" . $bn . "'";
$rq = mysql_query($q, $con);
if (!$rq) {
echo " the sql query faiiled to work ";
} else {
echo "the query executed sucessfully";
}
?>
答案 0 :(得分:1)
INSERT
语句不支持WHERE
子句。
答案 1 :(得分:1)
您要更新数据库还是插入?
INSERT
不适用于WHERE
条款。