I have a while loop that display data from table student and an extra column that displays a drop down selection from employee table id which when selected, updates the id in student table. I have the following codes but on displaying it shows only 1 data from the employer table each line.
Here is the while loop. Any help would be appreciated, Thanks in advance.
while(($row = mysql_fetch_array($search_result)) && ($row1 =mysql_fetch_array($search_result2))){
echo"<form action=manualallocation.php method=post>";
echo"<tr>";
echo "<td>" . $row['stud_ID']."</td>";
echo "<td>" . $row['stud_NAME']."</td>";
echo "<td>"."<Select name='ex1'>"."<option value='" .$row1['emp_id'] ."'>" .$row1['emp_id'] ."</option>"."</select>";
echo "<td>" . "<input type='char' name='emp_location' value='" .$row1['emp_location'] . "'/> </td>";
echo "<td>" . "<input type='char' name='stud_FIELDOFSTUDY' value='" .$row['stud_FIELDOFSTUDY'] . "'/> </td>";
echo "<td>" . "<input type='char' name='student_yearCompleted' value='" .$row['student_yearCompleted'] . "'/> </td>";
echo "<input type='hidden' name=hidden value=" . $row['stud_ID'] . ">";
echo "<td>" . "<input type='submit' name='submit' value=update". "></td>";
echo "</tr>";
echo "</form>";
}