<td class="border"><div align="left" class="stdtxtgrey"><?php include("db_connect.php"); // start and loop through all the accounts for the dropdown list echo "<select name=company>"; // form the query for selecting info from accounts $query="SELECT * FROM accounts ORDER BY name"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); $i=0; while ($i < $num_rows) { $id5 = mysql_result($result, $i, "id"); $name5 = mysql_result($result, $i, "name"); echo "<option value='$id5'>$name5</option>"; } echo "</select>"; mysql_close(); ?></div></td>