From: Mag Gam <magawake@gmail.com>
To: pgsql-php@postgresql.org
Subject: HTML FORMS selected question
Date: Sun, 3 Dec 2006 17:42:36 -0500
Message-ID: <1cbd6f830612031442g23828ca7wad97fa4905aacc65@mail.gmail.com> (raw)
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!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: magawake@gmail.com
Subject: Re: HTML FORMS selected question
In-Reply-To: <1cbd6f830612031442g23828ca7wad97fa4905aacc65@mail.gmail.com>
References: <1cbd6f830612031442g23828ca7wad97fa4905aacc65@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox