My student.php page: Displayin questions with their multiple choices randomly from database
 <form name="f1" id=f1 method="get" action="submittingquiz.php">
        <?php
        $correct=array();
      $query=  mysql_query("select 
     question_number,question_description,correctanswer_id from 
     quizzesbankofquestion where course_code='MATH220' && quiz_level='1' && 
     level_of_difficulty='1' ORDER BY RAND() LIMIT 3");
     if (!$query) die ("Database access failed: " . mysql_error());
       $row=  mysql_num_rows($query); 
      if($row!=0){
      while($questions=  mysql_fetch_array($query)){
          $correct=array($questions[2]);
          $_SESSION['array']=$correct;
        echo "<table>
         <tr><td> $questions[0]</td>
                  <td>$questions[1]</td> </tr>";
          $choices=  mysql_query("select choices_id,choices_descriptions
        from quiz_choices where course_code='MATH220' && 
        question_number='$questions[0]'ORDER BY RAND() ");
          if (!$choices) die ("Database access failed: " . mysql_error());
          while($questionchoices=  mysql_fetch_array($choices)){
             echo "<tr><td><input type='radio' value='$questionchoices[0]' 
          name='$questions[0]'/>$questionchoices[1]</td></tr></table>";}
           }}?>
    <input type="submit" id="btn_submit" name="btn_submit" value="submit" />
      </form>
Submitting.php
  <?php
    require_once 'connect.php';
    session_start();
    $numCorrect = 0;
    $answers=array();
    if(isset($_SESSION['array'])){
         print_r ($_SESSION['array']); //it is not printing the same array as $correct,It is only printing one element
        $correct=$_SESSION['array'];
    foreach($correct as $key=>$val){
       $answers=$_GET['$questions[0]'];//trying to get the values of the radio buttons and store it in array
        print_r($answers);// displaying Array word only
   if($val = $answers[$key]){
   $numCorrect++;
    }
     }  }?>
The array session is not displayed the same,also I didn't know how can I fill the value of the radio buttons in the array.I am trying to compare the correct answers. Thank you in advance
 
     
     
    