<?php
//get the q parameter from URL
$q=$_GET["q"];//lookup all hints from array if length of q>0
require("../common/database.php");
$q_string="select Q_Id from kid_qid where K_Id=(select dkp_Id from client_key_person where Id like '".$q."%')";
$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++;
}
for($j=0;$j<count($q_ids);$j++){
$q_string1="select Question 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 '<input type="checkbox" id="'.$q_ids[$j].'" name="'.$q_ids[$j].'" />'.$dataset."<br>";
}
}
}
?>