http://dev.mysql.com/doc/refman/5.0/en/join.html
you could use something like this:
SELECT DISTINCT thumbnails.gallery, thumbnails.id,
thumbnails.binary_data FROM thumbnails
you can insert everything you want from your table after the DISTINCT
by writing:
table.colName
/frank
27 aug 200
Here is one way of doing it:
Group by gallery and return max for image id.
Place the resultant Gallery and Image values in an array of arrays.
SELECT Gallery, Max(Image) FROM Thumbnails GROUP BY Gallery
Then loop over the outer array returning the entire thumbnail row where
gallery and image
From: Dave Goodchild
To: Ross
Cc: php-general@lists.php.net
Sent: Sunday, August 27, 2006 8:21 PM
Subject: Re: [PHP] display a single thumb per gallery
To find out how many unique galleries:
SELECT DISTINCT gallery FROM table
Ross
--
PHP General Mailing
To find out how many unique galleries:
SELECT DISTINCT gallery FROM table
Ross
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk
I have a database of images, http://www.thethistlehouse.com/db.jpg
What I want to do is select ONLY ONE image to display as a the image link
for that gallery. As you can see galleries are numbered dynamcially but
galleries can also be added and deleted so the galleries no's I have now (7,
8) wi
5 matches
Mail list logo