Hi

I have

1.database already set up with around 5000 products with all fields required.

2. create a page template with query code and code to echo out the results of the fields of a product.

I now need to know how to make each product from the database produce a page based upon what i already have.

Please can someone help as i have been searching the net for hours to try and find something to help

Thanks in advance

I'm not 100% positive I know what you're asking because page 2 kind of sounds like the same thing as what you are asking for but I'll give it a guess.

Each product in the database should have a primary key, probably something like productID or pID. Create one page like viewProduct.php that requires a variable in the GET. Links to this page would look something like viewProduct.php?productID=136. Then you only pull data from the database where the productID(in the database) is = to that productID(in the GET).

I hope this gives you a good starting point.

thanks for your reply, i will try and serach for that information you have given me

any links to help would be great

Member Avatar for diafol

The querystring holding the id value is the key to this. Pick it up with $_GET. Use the value in your db select query.

Use this Keywords to Search in Google for what you want to do!!!

1. creating database driven php pages
2. PHP MYSQL Database driven Product Pages
3. MYSQL and PHP + Product Pages

All the Best!!!

Hi

I have

1.database already set up with around 5000 products with all fields required.

2. create a page template with query code and code to echo out the results of the fields of a product.

I now need to know how to make each product from the database produce a page based upon what i already have.

Please can someone help as i have been searching the net for hours to try and find something to help

Thanks in advance

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.