0

<?php
session_start();
if(isset($_POST)){
$a=$_POST;
}
if(!isset($a)){
$a=0;
}
$q = $_SESSION;
include('dbconfiguration.php');
$sql1="SELECT * FROM question WHERE question_id='1' LIMIT 1 OFFSET 0 $q";
$result=mysql_query($sql1);
echo $sql1;
echo "<form method='post' action=''>";
while ($row = mysql_fetch_array($result))
{
echo $row. "<br/>";
echo "<input type='radio' value='answer1' name='answer'>" .$row;
echo "<input type='radio' value='answer1' name='answer'>" .$row;
echo "<input type='radio' value='answer1' name='answer'>" .$row;
echo "<input type='radio' value='answer1' name='answer'>" .$row. "<br/>";
}
$a=$a+1;
echo "<input type='hidden' value='$a' name='a'>";
echo "<input type='submit' name='previous' value='previous'> ";
echo "<input type='submit' name='next' value='next'> ";
echo "<input type='reset' name='reset' value='Reset'>";
echo "<input type='submit' name='submit' value='summary'>";
echo "</form>";
?>

This my code fetch the record set from mysql and display it question with four option answer. I want to press next button or previous button the question move according to question id and finally press summary button it displays number of question answered , unanswered, marks .. how to do this

2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by StephNicolaou
0

To go to then next question, you just need to increment the question_id value by one each time the next button is pressed. Then just increment a count value every time an option box is selected.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.