Displaying Query Results
Posted: Tue Jul 04, 2006 6:38 pm
I have another question for all you PHP masters! Now that I can display all the information about a particular query from a database, I want to know the more commonly used technique of listing items on a page that link to a dynamic query which is displayed by a php page. If that was hard to follow then it will make more sense in a second.
Think about online shopping places. They have picture links or texts links that, when clicked on, load a dynamic php page that queried for particular results based on the link that was clicked.
So I want to make a list of links like so,
HTML Code:
<html>
<body>
<br><a href="">Earring-RA-01</a>
<br><a href="">Earring-RA-02</a>
<br><a href="">Earring-RA-03</a>
<br><a href="">Earring-RA-04</a>
<br><a href="">Earring-RA-05</a>
</body>
</html>
Now each one of these links will link to a product.php info page that queries the database for information specific to the link clicked.
How do I do this...? NOTE: The linkage part is the ONLY thing I'm concerned with, I already know how to actually display the the data once I have it.
P.s the queries will look like this for me
Think about online shopping places. They have picture links or texts links that, when clicked on, load a dynamic php page that queried for particular results based on the link that was clicked.
So I want to make a list of links like so,
HTML Code:
<html>
<body>
<br><a href="">Earring-RA-01</a>
<br><a href="">Earring-RA-02</a>
<br><a href="">Earring-RA-03</a>
<br><a href="">Earring-RA-04</a>
<br><a href="">Earring-RA-05</a>
</body>
</html>
Now each one of these links will link to a product.php info page that queries the database for information specific to the link clicked.
How do I do this...? NOTE: The linkage part is the ONLY thing I'm concerned with, I already know how to actually display the the data once I have it.
P.s the queries will look like this for me
Code: Select all
$sql = "SELECT * FROM `Earrings` WHERE `Product_Name` LIKE 'Earring-RA-01' LIMIT 0 , 30";
$sql = "SELECT * FROM `Earrings` WHERE `Product_Name` LIKE 'Earring-RA-02' LIMIT 0 , 30";
$sql = "SELECT * FROM `Earrings` WHERE `Product_Name` LIKE 'Earring-RA-03' LIMIT 0 , 30";
$sql = "SELECT * FROM `Earrings` WHERE `Product_Name` LIKE 'Earring-RA-04' LIMIT 0 , 30";
$sql = "SELECT * FROM `Earrings` WHERE `Product_Name` LIKE 'Earring-RA-05' LIMIT 0 , 30";