Skip site navigation (1) Skip section navigation (2)

HTML FORMS selected question

From: "Mag Gam" <magawake(at)gmail(dot)com>
To: pgsql-php(at)postgresql(dot)org
Subject: HTML FORMS selected question
Date: 2006-12-03 22:42:36
Message-ID: 1cbd6f830612031442g23828ca7wad97fa4905aacc65@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-php
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!

Responses

pgsql-php by date

Next:From: ChrisDate: 2006-12-03 23:08:09
Subject: Re: HTML FORMS selected question
Previous:From: Moller, CameronDate: 2006-11-14 00:18:20
Subject: Re: Unsubscribe - Instructions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group