4 Replies Latest reply on Oct 27, 2006 1:49 PM by MikerRoo

    Table Join? Lookup Table?

      I'm working on a application that needs to allow a user to reorder items they have previously purchased. I have 3 tables I need to work from (I think) The first table is the customer info that contains their ID number:

      Customer1 | 8761
      Customer2 | 5487
      Customer3 | 2365

      A second table that contains all of the available products and their ID

      Product1 | 1001
      Product2 | 1010
      Product3 | 2001
      Product4 | 2020
      and so on...

      And a third table that contains the info for which products any given customer has ordered previously
      Customer1 for example has ordered Product1, Product2 and Product3 previously:

      8761 | 1000
      8761 | 1010
      8761 | 2000

      Where I'm pulling my hair out, is how do I get the product names from the products table after Customer1 logs in with his ID?

      I can a list of the products he's ordered easy enough:
      SELECT prodID
      FROM orders
      WHERE prodID = custID

      And get 1000,1010,2000

      Now I need to query the product table to get the product name that goes with each ID...

      Can anyone shed some light on this one for me?

      Thanks in advance,