I am working on an ecommerce project where user can upload multiple images(3 max) and then on my home page i will display one product img per categories.So i have design a db for the images,articles and categories. HERE IS MY DB
categories
[php]catid (int primary auto increment)
catname (varchar)[/php]
userarticles
[php]id (int primary auto increment)
user_id (index)
idcat
nomarticle
price[/php]
article_imgs
[php]imageid (int primary auto increment)
articleID (index)
filenames[/php]
I got to inseting the uploaded images into the db correct. But now when i query the db for displaying one image for each
article(cause each article has its own id) …instead of one image, all the images are coming
HERE IS MY QUERY
[php]
SELECT id,nomarticle,price,filenames FROM userarticles AS product INNER JOIN article_imgs AS img ON img.articleID = product.id WHERE product.id = 2[/php]