MySQL Forums
Forum List  »  PHP

Trying to retrieve data where a variable is in an array
Posted by: webmaster
Date: February 18, 2010 04:42PM

Okay, I have a column in my MySQL table that stores the data, due to how it's received, as a comma delimited array, eg 2,5,23,28. This array is of variable length.

What I would like to do is SELECT a row from the table where that array contains a variable, eg if $variable is '3' then it would retrieve a row that has 1,3,13,18 in the array, but not one like 1,13,23. LIKE doesn't seem to be working correctly. Is there any way of doing this?

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.