selecting 3 images
am 10.01.2006 12:13:26 von patrickHi all,
I am not very good at sql, so anything remotely beyond simple, it goes
over my head.
I have a table which contains various fields, including 3 image fields.
(image1_id, image2_id, image3_id). Each of these fields contains the id
of an image found in the images table, (id, image).
I need to pull all three images out and use them, which is where I get
stuck. To use just one image, I use the following:
SELECT " . DB_PREFIX . "news.id, tagline, article, image
FROM " . DB_PREFIX . "news
LEFT JOIN " . DB_PREFIX . "images
ON image1_id = " . DB_PREFIX . "images.id
WHERE main='on' LIMIT 1
and I am able to refer to the image as image. But how do I pull out all
three to use them? I hope this is clear enough, let me know if you need
any mor information.
Thanks
Patrick