<?php
//get the q parameter from URL
$q=$_GET["quiz"];//lookup all hints from array if length of q>0
$k_p=$_GET["keyperson"];
//echo $k_p;
require("../common/database.php");
$my_query="select * from client_key_person where Id='".$k_p."'";
//$my_query="select Dkp_Id from client_key_person where Name like 'A.B.C. Fernando'";
$my_result=mysql_query($my_query,$link);
$raw=mysql_fetch_array($my_result);
$k_p=$raw['Dkp_Id'];
$q_string="select distinct Q_Id from selected_quiz where turn='".$q."' and Person_Id='".$k_p."'";
$result=mysql_query($q_string,$link);
$q_ids;
if (strlen($q) > 0){
$dataset="";
$i=0;
while($row=mysql_fetch_array($result)){
$q_ids[$i]=$row['Q_Id'];
//$dataset=$row['Q_Id'];
$i++;
//echo $dataset;
}
//creating list of questions
$quiz_no=1;
for($j=0;$j<count($q_ids);$j++){
$q_string1="select * from quiz where Id='".$q_ids[$j]."'";
$ques_result=mysql_query($q_string1,$link);
while($row1=mysql_fetch_array($ques_result)){
$dataset=$row1['Question'];
echo "<br>".$quiz_no.").".$dataset."<br>";
$quiz_no++;
}
}
}
?>