Forum Moderators: coopster
<select multiple size="5" name="groups[]">
<option value="1">group 1
<option value="2">group 2
<option value="3">group 3
<option value="4">group 4
<option value="5">group 5
</select>
What is the most efficient way to store these values in a MySql database for later retrieval?
My current way of doing it would involve creating a string from the selected values and using a character to pad them.
e.g "-2-4-"
so then i would try and retrieve them using a query like
"SELECT * FROM table WHERE (field LIKE'%-2-%') OR ('field LIKE'%-4-%')"
Is there a better way to do this?
I hope this helps.