The more I think about this the more I think there is a fundamental problem with my design. I have a form. I have a select input option. Users can select up to four items from the list. The options each have a number associated with them. When the form is submitted the number of each option selected is added together, separated by a comma and added to a column in the database. I have no control over the order in which they select the options. There are a total of 30 options they can choose from. So I end up with 4 numbers in the column ranging from 1-30 in not particular order. At some point the user will select an option in another screen and all the information relating to that option should be displayed in tabular form. I am struggling to get just one option number back from the database. I have selected the column with the option numbers in from the database and passed it to explode() using the comma as the delimiter but its not returning anything. If I do a var_dump on the $rows returned by the query on the database column I can see all the information has been retrieved. So Im close. This is how I am exploding the returned data.
var_dump(explode(',' , $rows['scat']));
The bigger problem may well be, once I get the information from the database is how do I extract a particular number from it given that it could be between 1 and 30 and in no particular order.