I have 2 tables:
table product
:
product_id | product_name | price | added_on | modified_on |
---|---|---|---|---|
1 | Phone | 100 | 2021-09-25 | 2021-09-25 |
table product_image
:
id | product_id | product_image1 | added_on | modified_on |
---|---|---|---|---|
1 | 1 | phoneimage.jpg | 2021-09-27 | 2021-09-27 |
I am trying to display product image table in a page with inner join but the problem is that I have same name for added_on and modified_on I want to select from table product
product_id
, product_name
, price
and from table product_image
all.
So far I have used this query:
SELECT * FROM `product_image`
INNER JOIN `product` ON product_image.product_id = product.product_id
ORDER BY `id` DESC
product image display: