Re: displaying a sing thumbnail

2006-08-28 Thread ross

$query = SELECT distinct gallery FROM thumbnails;

that only returns the numbers 7  8. I need the all the info from the rows - 
id, binary data etcsomething like (although it doesn't work)


$query = SELECT * FROM DISTINCT gallery FROM  thumbnails;


any ideas?
- Original Message - 
From: Michael Stassen [EMAIL PROTECTED]

To: [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Sent: Saturday, August 26, 2006 6:05 PM
Subject: Re: displaying a sing thumbnail



[EMAIL PROTECTED] wrote:

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) will change. I have the code to display the thubnail but am stuck 
with the query.


I want to use mysql and php to

(i) determine how many unique galleries there are.


To list the galleries:

  SELECT DISTINCT gallery FROM yourpicturetable;

To count them:

  SELECT COUNT(DISTINCT(gallery)) FROM yourpicturetable;

(ii) Retrieve  display a single thumbnail from each gallery to act as 
the link to that gallery


That should be easy, but first you must tell us how you determine which 
picture in each gallery is the desired thumbnail.


Michael





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



displaying a sing thumbnail

2006-08-26 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) will 
change. I have the code to display the thubnail but am stuck with the query.

I want to use mysql and php to

(i) determine how many unique galleries there are.

(ii) Retrieve  display a single thumbnail from each gallery to act as the link 
to that gallery


Ross

Re: displaying a sing thumbnail

2006-08-26 Thread Michael Stassen

[EMAIL PROTECTED] wrote:

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) will 
change. I have the code to display the thubnail but am stuck with the query.

I want to use mysql and php to

(i) determine how many unique galleries there are.


To list the galleries:

  SELECT DISTINCT gallery FROM yourpicturetable;

To count them:

  SELECT COUNT(DISTINCT(gallery)) FROM yourpicturetable;


(ii) Retrieve  display a single thumbnail from each gallery to act as the link 
to that gallery


That should be easy, but first you must tell us how you determine which picture 
in each gallery is the desired thumbnail.


Michael

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]