0
public function display( )
{

$query="SELECT * FROM test  ORDER BY RAND() limit 5  ";
$result=mysql_query($query)or die("cannot select DB");
$num=mysql_numrows($result);
echo "<table>";
echo "<tr>"."<td style='overfolw-hidden;width:400px;'> Question: </td>";
echo "<td style='overfolw-hidden;width:40px;'> OPTION A </td>";
echo "<td style='overfolw-hidden;width:40px;'> OPTION B </td>";
echo "<td style='overfolw-hidden;width:40px;'> OPTION C </td>";
echo "<td style='overfolw-hidden;width:40px;'> OPTION D </td>";
echo "</tr>";

while($row = mysql_fetch_array($result))
  {
echo"<tr>";
echo "<td>" . $row['question'] . "</td>";
echo "<td>$row[a]<input type='radio' name='opt' value='$row[a]'> </td>";
echo "<td>$row[b]<input type='radio' name='opt' value='$row[b]'> </td>";
echo "<td>$row[c]<input type='radio' name='opt' value='$row[c]'> </td>";
echo "<td>$row[d]<input type='radio' name='opt' value='$row[d]'> </td>";
echo"</tr>";
}

echo"</table> <br/>";

}

Quoted Text Here

here 5 questions with their respective answers can be visible.but we have to choose one radio button for 1 question.but it can allowing to choose only 1 radio button for all questions. wat can i do now

please help me as soon as possible

Edited by Venter: gfgfgf

2
Contributors
1
Reply
2
Views
4 Years
Discussion Span
Last Post by pritaeas
0

If you have a $row['id'] you can postfix that to the name of the radiobutton. If not, just use a counter which increases every iteration.

This question has already been answered. 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.