Re: Still trying to figure this out...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux