$result123=mysql_query("select *from semdropdown");
<td><label for="textfield8">Semester </label></td>
<td colspan="3"><select name="semester" value="<?php echo $semesterid; ?>">
<option value="">Select Semester</option>
<?php
while($row123 = mysql_fetch_array($result123))
{
if($semesterid == $row123[semesterid])
{
$selvar = "selected";
}
echo "<option value='$row123[semesterid]' ". $selvar . ">$row123[semesterkey]</option>";
$selvar ="";
}
?>
</select>
</p>
<p></p></td>
</tr>
$result123=mysql_query("select *from semdropdown");
<tr>
<td><label for="textfield8">Semester </label></td>
<td colspan="3"><select name="semester" value="<?php echo $semesterid; ?>">
<option value="">Select Semester</option>
<?php
while($row123 = mysql_fetch_array($result123))
{
if($semesterid == $row123[semesterid])
{
$selvar = "selected";
}
echo "<option value='$row123[semesterid]' ". $selvar . ">$row123[semesterkey]</option>";
$selvar ="";
}
?>
</select>
</p>
<p></p></td>
</tr>