recordset issues

Discussion in 'ASP General' started by Guest, Apr 26, 2005.

  1. Guest

    Guest 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

    -----------------------------
    This message is posted by http://asp.forumszone.com
     
    Guest, Apr 26, 2005
    #1
    1. Advertising

  2. Guest

    McKirahan Guest

    <> wrote in message
    news:...
    > 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.
     
    McKirahan, Apr 26, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vikas Yadav
    Replies:
    0
    Views:
    1,141
    Vikas Yadav
    Sep 9, 2003
  2. gary artim

    recordset error/perl messages

    gary artim, Feb 6, 2004, in forum: Perl
    Replies:
    0
    Views:
    501
    gary artim
    Feb 6, 2004
  3. Bob
    Replies:
    0
    Views:
    408
  4. NAIME ESTEVES

    RECORDSET

    NAIME ESTEVES, Jul 10, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    563
    NAIME ESTEVES
    Jul 11, 2003
  5. Hung Huynh
    Replies:
    8
    Views:
    329
    Bob Barrows
    Sep 24, 2003
Loading...

Share This Page