Rob W. wrote:
> Nope, I still dont get anything back from that.

it will AT THE VERY LEAST return the string:

        '<select name="port"></select>'

do you have any idea what you have in your database???

and have you ever heard of print_r() or var_dump()? you can use them
to *investigate* your problem.

...

>> $sqlRange = array();
>> if ($res = mysql_query('SELECT switchport FROM network')) {
>> while ($row = mysql_fetch_array($res)) $sqlRange[] = $row['switchport'];
>> }

var_dump($sqlRange, array_diff(range(1,24), $sqlRange));

>>
>> echo '<select name="port">';
>> foreach (array_diff(range(1,24), $sqlRange) as $port) {
>> echo '<option value="',$port,'">',$port,'</option>';
>> }
>> echo '</select>';
>>
>> /*
>>
>> NOTE:
>>
>> 1. you have to loop your mysql result to get each port that is already
>> used in the DB into you array
>> 2. try to output something that resembles proper HTML (an <option>
>> without a closing tag sucks)
>>
>> */
>>
>>
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to