Hi,
I’m not great with joins but I’m trying to select each individual entry from one table and all linked images from another like so:
$q = "SELECT
c.*,
ci.imageID,
i.imageFile
FROM
".DB_PREFIX."cars c
LEFT JOIN
".DB_PREFIX."carimages ci
ON
ci.carID = c.carID
LEFT JOIN
".DB_PREFIX."images i
ON
i.imageID = ci.imageID
WHERE 1";
Problem is, each car is being selected multiple times. If there are 3 images, the car is shown 3 times.
Where am I going wrong? I’ve tried INNER JOIN but had no luck.
Cheers,
Rhys