mysql select query problem

Posted by Chocho on Stack Overflow See other posts from Stack Overflow or by Chocho
Published on 2010-04-08T15:40:12Z Indexed on 2010/04/08 15:43 UTC
Read the original article Hit count: 304

Filed under:
|

i have a form that has a multiple select drop down. a user can select more than one options in the select. the name of the select is array[]; using php i implode(",",$array) in mysql db, it stores the field as a text in this format "places"= "new york, toronto, london" when i want to display these fields i explode the commas.

i am trying to run a report to display the places. here is my select:

"select * from mytable where db.places .. userSelectedPlaces"

how can i check toronto in lists of "places" that user selected? note "places" in the db might be either just "toronto" or it might be comma separated lists of places like "ny, toronto, london, paris, etc".

© Stack Overflow or respective owner

Related posts about mysql

Related posts about query