Jump to content

Storing an array of strings in mysql and using the IN() function on it


farzher

Recommended Posts

So, I want to be able to do this: "WHERE something IN(SELECT array FROM table WHERE id='$id')"

So that I can select the array of strings and use the IN function on it.

 

Is this possible? Right now I have to select the CSV array of strings ex: "one,two,three" and format it like this "'one','two','three'" using php then do a second select passing that sting into the IN function.

 

What kind of format would I need to use to get this to work in one query with mysql?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.