Sorry for being anouing i had the weekend to do this question site for my teacher like sam learning nearly done after 31 hourscanyou help
Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in C:\wamp\www\learner\userpref\takeanswers.php on line 7
<?php
$ID=$_REQUEST['ID'];
$sql="SELECT * FROM `questions` WHERE ID='$ID'";
@$result = mysqli_query($cxn, $sql);
$i=0; $q=0;
$row = mysqli_fetch_assoc($result);
$gaa=$_REQUEST['gaa']; if($gaa){$q++;
if($gaa == $row['a1']){$i++;
echo "Question 1 Was Correct"; } else { echo "Question 1 was incorrect"; } echo "<br>";}
$gab=$_REQUEST['gab']; if($gab){$q++;
if($gab == $row['a2']){$i++;
echo "Question 2 Was Correct"; } else { echo "Question 2 was incorrect"; } echo "<br>";}
$gac=$_REQUEST['gac']; if($gac){$q++;
if($gac == $row['a3']){$i++;
echo "Question 3 Was Correct"; } else { echo "Question 3 was incorrect"; } echo "<br>";}
$gad=$_REQUEST['gad']; if($gad){$q++;
if($gad == $row['a4']){$i++;
echo "Question 4 Was Correct"; } else { echo "Question 4 was incorrect"; } echo "<br>";}
$gae=$_REQUEST['gae']; if($gae){$q++;
if($gae == $row['a5']){$i++;
echo "Question 5 Was Correct"; } else { echo "Question 5 was incorrect"; } echo "<br>";}
$gaf=$_REQUEST['gaf']; if($gaf){$q++;
if($gaf == $row['a6']){$i++;
echo "Question 6 Was Correct"; } else { echo "Question 6 was incorrect"; } echo "<br>";}
$gag=$_REQUEST['gag']; if($gag){$q++;
if($gag == $row['a7']){$i++;
echo "Question 7 Was Correct"; } else { echo "Question 7 was incorrect"; } echo "<br>";}
$gah=$_REQUEST['gah']; if($gah){$q++;
if($gah == $row['a8']){$i++;
echo "Question 8 Was Correct"; } else { echo "Question 8 was incorrect"; } echo "<br>";}
$gai=$_REQUEST['gai']; if($gai){$q++;
if($gai == $row['a9']){$i++;
echo "Question 9 Was Correct"; } else { echo "Question 9 was incorrect"; } echo "<br>";}
$gaj=$_REQUEST['gaj']; if($gaj){$q++;
if($gaj == $row['a10']){$i++;
echo "Question 10 Was Correct"; } else { echo "Question 10 was incorrect"; } echo "<br>";}
echo "You got $i correct answer(s) out of the $q question(s), these were stored for your teacher ";
echo $row['teacher'];
?>