I have a multiselect combobox on the html page. The actual list of countries is about 60 items.
<select name="country[]" multiple="multiple">
<option value="UK">United Kingdom</option>
<option value="FR">France</option>
<option value="DE">Germany</option>
<option value="JP">Japan</option>
</select>
In the Database, the country list is stored as a comma delimited string in the rows such as project one may be uk,de or fr,de,jp and so forth.
I would like to be able to select multiple items in the combobox and pull up the projects so that projects with any of the countries selected with the country will display. An issue is that the column country is stored a comma delimited string value.
SELECT * FROM projects WHERE FIND_IN_SET("country","DE, UK")'
My issue is that the FIND_IN_SET will only match the entire string. The above code may find a project with country that has only DE or UK but will not find one with "FR,UK" for example.
How do I parse the column country and create the SQL query to display the countries that I selected in the combobox?