recordset issues

G

Guest

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
 
M

McKirahan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top