Each row has a select dropdown, so if in the 1st row dropdown, a name has been selected and saved to the database, next time the 1st row's dropdown will show respective name based on db record.
For the 2nd, 3rd and 4th row's dropdown will show a select dropdown without any name being selected
Now i can only work out how to do it by hardcoding. But as i said the no of student name is unknown as it can be added or deleted. Is there anyway i can select the student name that has been saved in the db previously
<td><select class="input" name="name[]" >
<option value="select" <?php if ($row['name'] == 'select') echo
'selected="selected"'; ?> > select</option>
<option value="<?php echo $_SESSION['name'] ?>" <?php if ($row['name'] ==
$_SESSION['name']) echo 'selected="selected"'; ?> > <?php echo
$_SESSION['name'] ?> </option>
</select></td>