I have these two queries
the first is
select image from product where product_id = '82';
which returns
data/1B.png
the second is this
select image from product_image where product_id = '82';
which returns
data/computer_system.png
data/post-image.png
data/13D.png
So i tried to combine them and i get in this query
select p.image, pi.image as additional_images from product as p join product_image as pi on pi.product_id=p.product_id where p.product_id = '82'
which returns this
data/1B.png data/computer_system.png
data/1B.png data/post-image.png
data/1B.png data/13D.png
I need either a query that will return the 4 locations and then setting them to a php array $images
any ideas….i know i can do the queries separately as i have above but would i just do an array_merge….but is there a better way
1 Answer