Hi, i am displaying questions with multiple answers from the database to users. he has to participate in the contest.
i have stored questions in questions table. qid, qtext.
answers in answers table. aid,atext,cans (correct ans)
i have displayed the questions and multiple answers from database. like this…
What is capital of India
1.Chennai (radio button)
2.Bangalore (radio button)
3.Delhi (radio button)
What is capital of England
1.London (radio button)
2.Paris (radio button)
3.Madrid (radio button)
This is the PHP code.
[php]$sql=“SELECT * FROM questions, answers WHERE answers.qid = questions.qid”;
$result=mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
if ($row[‘qtext’] != $lastQuestion) {
echo “
” . $row[‘qtext’] . “
”;
$lastQuestion = $row[‘qtext’];
}
echo “<input type=‘radio’ name=’”.$row[‘qid’]."’ value=’".$row[‘aid’]."’ />".$row[‘atext’];
[/php]
i want to store the users result into the database. how can i make this as form for user can select answers and submit… so i can store the results in the database. i am new to php… please help…