at the moment i have the following code for my quiz

this bit gets the question

PHP Code:

"SELECT QNO, Question, AnsA, AnsB, AnsC, AnsD, Answer FROM ip4quiz WHERE QNO ='3'"
$resultq3 mysql_query($queryq3);

while (
$row mysql_fetch_array($resultq3)) {
$questionno3 $row['QNO'];
$question3 $row['Question'];
$ansa3 $row['AnsA'];
$ansb3 $row['AnsB'];
$ansc3 $row['AnsC'];
$ansd3 $row['AnsD'];

then echos it out, the next bit marks it

PHP Code:
<?php $queryq2 "Select * from ip4quiz WHERE QNO ='2'";

$resultq2 mysql_query($queryq2);

while (
$row mysql_fetch_array($resultq2)) {
$qno2 $row['QNO'];
$question2 $row['Question'];
$ansa2 $row['AnsA'];
$ansb2 $row['AnsB'];
$ansc2 $row['AnsC'];
$ansd2 $row['AnsD'];
$ans2 $row['Answer'];

    if (
$question2result == $ans2) { 
"<table border=0 width=100%>";
"<tr><th><h3 align=left><img src=\"../images/quiz/quizcorrect.jpg\" />You answered Question: {$qno2} {$question2result} - This is Correct! </th></tr>\r\n"
    } else { 
"<table border=0 width=100% bgcolor=003366>";
"<tr><th><h3 align=left><img src=\"../images/quiz/quizinincorrect.jpg\" />You answered Question: {$qno2} {$question2result} - This is Incorrect, The Correct answer is {$ans2}</th></tr>\r\n"

how can i make it pick from a list of questions at random instead of being told QNO = etc. my attempts have failed so far, any suggestions?