| McKirahan 2005-04-26, 5:55 pm |
| <jamie@dontforget.me.uk> wrote in message
news:691502005370317@asp.forumszone.com...
> Hi Everyone
>
> Here is my dilemma
>
> I have a database within that, two tables products and images.
>
> They are related by product_id. I have designed it so that one product can
have many images associated with it.
>
> My problem however is when I come to build the thumbnail page.
>
> What I would like to be able to do is display ONE image as a thumb that
when clicked would go to the product_detail page where the product would
then display all of the images associated with it.
>
> I am having difficulty in selecting just one thumb when I associate it
with the product_id. I have tried SELECT DISTINCT but this only allows me to
select the product_id and therefore I cannot retreive any other data from
the recordset.
>
> Has anybody got any ideas. I really need to get the thumb_image and
product_id from the two tables into one recordset in order to apply
recordset paging.
>
> This one has me really stumped.
>
> Help greatly appreciated
> Jamie
Also, what OS and database (+ version) are you using?
Hopefully, your "images" table only contains references to
the images (i.e. filenames) as opposed to the actual images.
Might your tables look like this?
"product" table:
product_id
product_desc
etc.
"images" table:
product_id
image_id
image_filename
etc.
If so, just use the first image for a given product_id.
|