I have 6 tables that i am trying to query but i am getting duplicate primary keys in the query result. Here are the tables :
userarticles
id nomarticles
1 escarpin_estelle
2 Tallon_grace
articlesize
productid idsizes
1 1
1 2
2 3
2 5
sizes
idsizes size
1 36
2 38
3 40
4 44
5 32
articlematieres
id_article id_matiere
1 2
1 1
2 3
2 3
matiere
matiereid matierename
1 daim
2 coton
3 polyster
article_imgs
imageid articleID filenames
1 1 rouge2017-10-03.jpg
2 1 2017-10-03-204220.jpg
3 2 moulante201.jpg
4 2 avec-decollete.jpg
The desire result should be to have
id articlename size filenames matiere
1 escarpin_estelle 38,45 rouge2017-10-03.jpg,moulante201.jpg coton,daim
Here ismy query :
SELECT id,nomarticle,filenames,size,matierename FROM userarticles AS products LEFT JOIN article_imgs AS images ON images.articleID = products.id LEFT JOIN articlesize AS prodt ON prodt.idarticle = products.id LEFT JOIN sizes AS s ON s.idsizes = prodt.idsize LEFT JOIN articlematieres AS prodmat ON prodmat.id_article = products.id LEFT JOIN matiere AS m ON m.matiereid = prodmat.id_matiere WHERE products.id = 1