Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- selecting 3 images
January 10, 2006, 11:13 am
rate this thread
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.
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum