Forum Moderators: coopster

Message Too Old, No Replies

Extracting product data from MySQL

         

DaveRFR

4:54 am on Jul 16, 2008 (gmt 0)

10+ Year Member



Ok so here is my question.

I run a website and we sell products online. For the most part the whole site is php using a mysql database to store all the sites data. All of the products are in the database with item name, part number, description, picture and price. In each sections page I have a table that prints the item name, picture and price info. And what I would like is to have the item name field be a link that will open the next page and print all the fields in full.. But I don't want to have to make a pages for every item if I don't have to. I am hoping there is a way to make the link carry the into on the item so it was go to the next page and tell it what info to get. Hope I'm making sense.

David.

[edited by: eelixduppy at 5:30 am (utc) on July 16, 2008]
[edit reason] removed specifics [/edit]

eelixduppy

5:53 am on Jul 16, 2008 (gmt 0)



Hello and Welcome to WebmasterWorld!

Do you have a unique ID associated with each item? You should. If this is the case you can send the ID number through the query to a script that processes and prints the details. The echoing of the link would resemble the following:


echo '<a href="/path/to/script.php?pid=' . $row['pid'] . '">' . $row['name'] . '</a>';

And then on the script.php page you can grab this ID using $_GET['pid'] and then run another query for this specific item.

DaveRFR

5:22 am on Jul 18, 2008 (gmt 0)

10+ Year Member



Hmm... Thanks for the answer. I am going to have to look into that. if anyone has anything else to add please do so.