HTML FORMS selected question

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



I am having trouble getting values populated in my form... Here is what I got so far:

//The values that need to be selected
$result_ip=pg_query($dbconn,$test_query);

<SELECT    NAME="ip[]" SIZE=10 MULTIPLE>
<?php
//This will show ALL values.
while($rows=pg_fetch_array($result)){
foreach ($options as $index => $option) {
    if ($rows[1]==$option)
    {
echo "<OptioN VALUE=\"$rows[0]\" selected=\"selected\">$rows[1]</Option> \n";
break;
        }
else
{
    echo "<OPTION VALUE=\"$rows[0]\">$rows[1]</OPTION> \n";
    break;
}
}
}

What am I doing wrong?

TIA!


[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux