Jump to content

single values into sql field


pbaker127

Recommended Posts

i have a form which i want the user to able to select multiple answers. But i want the answers to be stored into a single field on the mysql table in the back end. e.g

 

the user may select red + blue + green and so in the field i want it to show red,blue,green.

 

is it best to list the options in like an array or how do i do this as i dont do much PHP and so am a bit rusty.

 

hope you can help

Link to comment
https://forums.phpfreaks.com/topic/190172-single-values-into-sql-field/
Share on other sites

well use checkboxes then loop through and concatenate each value together with some kind of separator "-" "_" or whatever.

 

so you would have red-blue-green etc.

 

store than in the db then if you need to output that data just use the explode fn on your separator character.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.