FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » populate pulldownbox from query
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: populate pulldownbox from query [message #174094 is a reply to message #174083] Sat, 21 May 2011 13:05 Go to previous messageGo to previous message
TK is currently offline  TK
Messages: 6
Registered: May 2011
Karma:
Junior Member
On 5/21/2011 2:29 AM, Co wrote:

> I do get the right data from the database.
> The listbox gets filled correctly.
>
> It is just that the name which is currently set as partner doesn't
> show in the box.
> I tried to fix that with:
> echo "<option value='$partner'>{$nt['rank']} {$nt['firstname']}
> {$nt['lastname']}</option>";
> Problem is that I cannot do it at first I have to wait until the do
> while loop for filling the listbox
> has run.
Inset this in your while loop:
// Substitue your variable names

$f='';
if($rowAff['c_id']==$row['ch_id']) {$f="selected=\"selected\"";}
echo "<option $f
value=\"{$rowAff['c_id']}\">{$rowAff['church']}</option>\n";}

$f makes the current choice show in the option box. If I understood the
problem correctly.


--
TK ~ aka Terry Kimpling
http://wejuggle2.com/
If you can be legally insane, can you not be illegally insane?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: he
Next Topic: Detecting Redirected Output
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 07:27:30 GMT 2024

Total time taken to generate the page: 0.04312 seconds