retrieve comma delimited data from a field in using SQL
- by Nichols
I've created a form in php that collects basic information. I have a list box that allows multiple items selected (ie housing, rent, food, water). If multiple items are selected they are stored in a field called Needs seperated by a comma.
I have created a report ordered by the persons needs. The people who only have one need are sorted correctly, but the people who have multiple are sorted exactly as the string passed to the database (ie. housing, rent, food, water) -- which is not what i want.
Is there a way to seperate the multiple values in this field using SQL to count each need instance/occurance as 1 so that there are no comma delimitations shown in the results?
CLICK FOR EXAMPLE