here is my code.....actually i want to generate Randam Quiz's .....as single quiz per page
here $_session['$max'] is the maximum questions that user select from our db
if (!isset ($_SESSION['$max'])){
$_SESSION['$max']=$_POST['sel_ques'];
$tempArray= array();
}
do
{
$qno=rand(1, $_SESSION['max']);
if (!@in_array($qno,$tempArray)) {
$tempArray[$r] = $qno;
$query="SELECT * FROM question WHERE qid=$qno" ;
$result=mysql_query($query);
$id=mysql_result($result,$i,"qid");
$question=mysql_result($result,$i,"question");
mysql_result($result,$i,"question");
$query1="SELECT * from answer where qid=$id";
$result1=mysql_query($query1);
$r++;
}
But it not working properly .......plz give ur suggestions