I have two tables images2 and image_data
So the goal is to have 1 table for ALL the image uploads (images2) and then the image_data is to assign that image with different options.
So for example, here is some sample data:
So image_id 10 has more than one row, because this image is associated with both TN and CQ. And they could also be associated with more than one language and slide, so I would add on to the second row and change slide_id or language_id .. if wanted to add more, than I would add a new row for it.
The goal is to have a list of all the images, and then when you click on it it pops up and you can edit the options and change it straight from there.
I need help writing a query. The one I have right now:
SELECT images2.id, images2.filename, image_data.slide_id, image_data.language_id,
image_data.type FROM images2
LEFT JOIN image_data ON images2.id = image_data.image_id
A couple things wrong with that query.. It is showing the duplicates, because image_id 10 has two rows.
But I need that second row of image #10 because I need to see that it is also associated with CQ so I can check the checkbox when it pops up.
So I need to create a query to show ALL the unique images no duplicates, with all of the options it has.
I'm not sure the best way to do this.. do I need to re-do the way my database tables are? Any help is appreciated.
Thanks.