MySQL Forums :: PHP :: Trying to retrieve data where a variable is in an array


Advanced Search

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


Subject Written By Posted
Trying to retrieve data where a variable is in an array webmaster 02/18/2010 04:42PM
Re: Trying to retrieve data where a variable is in an array Rick James 02/21/2010 10:37AM
Re: Trying to retrieve data where a variable is in an array webmaster 02/21/2010 01:32PM
Re: Trying to retrieve data where a variable is in an array Rick James 02/21/2010 03:59PM
Re: Trying to retrieve data where a variable is in an array webmaster 02/21/2010 04:07PM
Re: Trying to retrieve data where a variable is in an array Rick James 02/21/2010 11:50PM
Re: Trying to retrieve data where a variable is in an array webmaster 02/22/2010 03:12AM
Re: Trying to retrieve data where a variable is in an array Rick James 02/22/2010 09:59AM
Re: Trying to retrieve data where a variable is in an array Tony Simek 03/10/2010 04:16PM
Re: Trying to retrieve data where a variable is in an array Peter Brawley 03/10/2010 08:53PM
Re: Trying to retrieve data where a variable is in an array Peter Brawley 02/21/2010 10:22PM
Re: Trying to retrieve data where a variable is in an array webmaster 02/22/2010 03:22AM
Re: Trying to retrieve data where a variable is in an array Peter Brawley 02/22/2010 09:42AM


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.