title: PHP - input type hidden to get id
body: <p>i want when user select one student name to get the student id as a hidden input to use it in the next page , the problem is when i added this to my code it doesn't show all students list to select from , it shows only one student name ( the first one stored in the database ) m any ideas ? !
  my code </p>
  
  <pre><code>  $sql = "SELECT s.Sname, e.PID , s.SID
                            from student AS s
                            INNER JOIN evaluator AS e                       
                            WHERE (e.EID1 = '$id' AND s.PID = e.PID) OR  (e.EID2 = '$id' AND s.PID = e.PID)
                            GROUP BY s.Sname  ";
           $result = mysql_query ($sql, $connection);
  
           echo "&lt;tr&gt;&lt;th &gt;Student Name &lt;font size='4'&gt;&lt;/font&gt;&lt;/th&gt;";
           echo "&lt;td&gt;&lt;select id='Sname' name='Sname' &gt;";
  
          echo "&lt;option value='' selected='selected'&gt;--&lt;/option&gt; ";
  
          while( $row = mysql_fetch_array($result))
     {
  
          echo "&lt;option value='$row[Sname]' &gt;$row[Sname]&lt;/option&gt; ";
          echo " &lt;input type ='hidden' name='SID' value='".$row['SID']."'  &gt;;
  
     }
  </code></pre>