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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-php by date

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