IanNav
Programmer
- Feb 26, 2001
- 79
Hi,
I’m sure this is simple one to most people, I just probably been thinking too hard...![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
problem : I have a mini CMS I’ve created. As usual i have an add, edit & remove screen for each item. (i.e. products).
how do I get a value from my MYSQL and auto select the right one in the combo box.
See Example.
Combo box contains the following options (hard coded):
"<please select>"
"Check availability"
"Confirmed"
"TBC"
"Cancelled"
I have done a mysql query and got the relevant info (stored in $data[status]).
how do I select the value from the list that matches my db data.
i.e., if $data[status] = TBC, how would I get the page to load with TBC selected.
I know I have to put "selected" next to the option but I can't get it to do it dynamically.
any help would be appreciated,
Many thanks
Ian
I’m sure this is simple one to most people, I just probably been thinking too hard...
problem : I have a mini CMS I’ve created. As usual i have an add, edit & remove screen for each item. (i.e. products).
how do I get a value from my MYSQL and auto select the right one in the combo box.
See Example.
Combo box contains the following options (hard coded):
"<please select>"
"Check availability"
"Confirmed"
"TBC"
"Cancelled"
I have done a mysql query and got the relevant info (stored in $data[status]).
how do I select the value from the list that matches my db data.
i.e., if $data[status] = TBC, how would I get the page to load with TBC selected.
I know I have to put "selected" next to the option but I can't get it to do it dynamically.
any help would be appreciated,
Many thanks
Ian