Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End mySQL: Query two tables for multiple results from array in first table? Re: mySQL: Query two tables for multiple results from array in first table?

#128592
__
Participant

Can you post your table schemas, please?

SHOW CREATE TABLE `events`
.

SHOW CREATE TABLE `options`

> I have a column in table `events` called `options`, that holds the ID’s of options assigned to each event … currently the ID’s are saved in the column like this: `1,2,3,4`

That’s likely going to be a problem, especially since you’re trying to use these values directly in a query.

Any given column should store *one* value, **not** a *collection* of values. That’s like buying a huge, fancy filing cabinet, labeling drawers for each letter of the alphabet, and then dumping all of your records into the `R` drawer (“R” for “records”).

For jobs like this, you need to use an *association table*. I can show you an example of how to do this once I see how your tables are constructed.