Re: [PHP] display a single thumb per gallery

2006-08-28 Thread Frank Arensmeier
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

Re: [PHP] display a single thumb per gallery

2006-08-27 Thread Alex Turner
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

Re: [PHP] display a single thumb per gallery

2006-08-27 Thread ross
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

Re: [PHP] display a single thumb per gallery

2006-08-27 Thread Dave Goodchild
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

[PHP] display a single thumb per gallery

2006-08-27 Thread Ross
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