I have a drop-down list box which has to be populated from a database in mysql. I implemented the following code:
//DB Conn done here..
<td>College Name,id :</td>
<td><select><option selected="selected">Choose a college...</option>
<?php
$query="SELECT nameid from college";
$result=mysql_query($query);
while ($line = mysql_fetch_array($result))
{
foreach ($line as $value)
{
echo "<OPTION value='$value'";
}
echo ">$value</OPTION>";
}
mysql_close($link);
print "</SELECT>";
?>
</select>
</td>
My problem is a new line is inserted between each entry in the drop-down list box. Pls help me to remove that empty line.