On Mon, June 19, 2006 3:39 pm, Rob W. wrote: > $query="SELECT switchport FROM network"; > $result=mysql_query($query); //If you wanna use fetch_array or whatever, fine. //But I dunno how to use it and don't care to learn. //And haven't felt the need for a decade now. //So there :-) while (list($switchport) = msyql_fetch_row($result)){ //> $sql_range=mysql_fetch_array($result); $sql_range[] = $switchport; } > $true_range=range(1,24); > $next_range=array_diff($true_range,$sql_range); > foreach ($next_range as $final_range) { > echo "<option value='$final_range'>$final_range\n"; > } Your previous code had only one (1) switchport from the DB, the first one in use. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php