I'm sure I'm getting the vaue of $bn
and $answer
on my page now I just want to insert the value in the column answer value $answer
where qid is $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";
}
?>