Maybe a strange topic title,
But I have 3 tables (ads, images, users).
Now I have querie which gives me all ads that are visible (=1) and from the choosen category.
"SELECT a.id, a.userid, a.title, a.views, a.price, a.isvisible, a.date, b.id, b.username
FROM adverts a, users b
WHERE a.userid=b.id AND categoryid='" . $_GET['id'] . "' AND isvisible='1'";
This works, however now I want also to get the images which belongs to the ads.
I thought to do this with an Inner Join, however then I get only the ads which have images (so ads with no images are not shown).
"SELECT adverts.id, adverts.title, adverts.views, adverts.isvisible, adverts.date, uploadimages.id, uploadimages.advertid, uploadimages.image
FROM adverts
LEFT JOIN uploadimages
ON adverts.id=uploadimages.advertid WHERE adverts.categoryid='" . $_GET['id'] . "' AND adverts.isvisible='1' GROUP BY adverts.id ORDER BY date DESC"
How can I get the ads to show with or without images