<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); while ($row = mysql_fetch_assoc($result)) { $id5 = $row['id']; $name5 = $row['name']; echo "<option value='$id5'>$name5</option>"; } echo "</select>"; mysql_close(); ?></div></td>