View Full Version : Displaying a list of products and link to a product page

04-26-2006, 03:01 AM
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.


04-26-2006, 03:14 AM
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.

04-26-2006, 04:01 AM
thanks missing-score... Any tutorials or books you could recommend to study some sample codes that accomplish this relationship?