I have a simple setup, where there are Products and Images.
Products have many images associated to them.
The tables are like this:
products:
images:
Ultimately, I want a single array of products that has a nested array for the images.
One option is to do two queries
The other option is to JOIN on images and then re-build a new array from the result and omit the repeated products and only assign new images.
Would anyone suggest a better solution?
Try a Left Join on product_id perhaps