It is a shopping cart, where user can add product to watchlist. Have a seprate page of User's watchlist where all product apepears that has been added to watchlist by that particular user. product_images table is separated from product table since 1 image can have multiple images.
MySQL Tables
Table "product" :
pid(pk),name,price, etc...
Table "watchlist" :
wid(pk),pid(fk),userid(fk)
Table "p_images" :
image_id(pk),pid(fk),image_name
I want to fetch all information from product table and only 1st image of that particular product from p_images table.
product should be fetch by pid in watchlist table.
select * from product p
inner join p_images i on p.pid = i.pid
where p.pid = 1
group by p.pid
order by image_id
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With