Jump to content


Photo

how to add items from multiple select


  • Please log in to reply
6 replies to this topic

#1 feri_soft

feri_soft
  • Members
  • PipPipPip
  • Advanced Member
  • 147 posts

Posted 01 September 2006 - 08:37 AM

How to add to the datatbase items from a multiple select in one field seperated by comas.

For example i have a select called extras and it has
Tv
fridge
pool


an so on.
how can i add the values a user have selected into the databse seperated by comma.

like
extras: tv,pool


Thanks



#2 scottybwoy

scottybwoy
  • Members
  • PipPipPip
  • Advanced Member
  • 532 posts
  • LocationUK

Posted 01 September 2006 - 09:18 AM

Are you using a radio buttins as a means of selection or what? You could put the results in an array and use implode.

#3 feri_soft

feri_soft
  • Members
  • PipPipPip
  • Advanced Member
  • 147 posts

Posted 01 September 2006 - 09:26 AM

I use a <select name="asdasd" multiple><option>........</select>


how exatcly to do the job,can you give me a working example

#4 scottybwoy

scottybwoy
  • Members
  • PipPipPip
  • Advanced Member
  • 532 posts
  • LocationUK

Posted 01 September 2006 - 10:00 AM

If your looking how to select multiple items in one selection box, then I do not know how to do it, without having multiple submit or select boxes, very messy?  Also are you getting your options from a database or are they static?

#5 feri_soft

feri_soft
  • Members
  • PipPipPip
  • Advanced Member
  • 147 posts

Posted 01 September 2006 - 10:57 AM

They are static....its easy to select some options holding control and clicking on different options
but in the database there is only the first option you clicked!?

#6 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 01 September 2006 - 11:02 AM

try printing the asdasd field. Like this.
print_r($asdasd);
See if that returns an array with the multipule options.


Good luck,
Tom

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#7 feri_soft

feri_soft
  • Members
  • PipPipPip
  • Advanced Member
  • 147 posts

Posted 02 September 2006 - 06:20 AM

I founded the solution with implode and explode...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users