Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Mar 2005
    Posts
    240
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Displaying a list of products and link to a product page

    Hi guys
    Just a quick question that perhaps you could refer me to a tutorial or a book.

    I have site with products... I've been able to create a product template page that queries the product image, description, price etc...

    But now I want to create an index page that a) queries the db for all the products in there and b) when they click the product link, it gets taken to the product page...

    I'm just wondering how that linking relationship can be established?

    For example, I know that the page name will be something like product.php?=id=223 or something like that but I don't know how to create that.

    Thanks

  • #2
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In many database types you can create unique AUTO_INCREMENT fields. This will automatically increase every time a new record is added to the database table and is the best way to get your unique product ID.

    On your homepage, you would query the DB and select the products, then build the link using id=the unique id, then when you get to the product page, the product would be loaded from the id.

  • #3
    Regular Coder
    Join Date
    Mar 2005
    Posts
    240
    Thanks
    1
    Thanked 0 Times in 0 Posts
    thanks missing-score... Any tutorials or books you could recommend to study some sample codes that accomplish this relationship?

    Thanks


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •