I use the code below to populate a dropdown box from mysql, problem is it goes to the end of the table when it does its stuff. Each colmb in the table has different amounts of records. So if a colmb has less data than the colmb with the largest amount of data it fills the end of the dropdown box with whitespace.
Can someone please show me how to fix this problem? I am a newbie.
<select name="Location1">
<?php
$query=mysql_query("SELECT $BusState FROM $locationtype");
while ($fetch=mysql_fetch_assoc($query)) {
echo '<option value="'.$fetch[$BusState].'">'.$fetch[$BusState].'</option>';
}
?></select>