mikebyrne Posted April 10, 2008 Share Posted April 10, 2008 I have a navigation tool on my page that says "CD'S UNDER £7" and from this link i want to goto a page called CD7 which will list all cd's under £7 two problems: I'm not 100% sure of the SQL below and how to make my link point to CD7.php The static link is currently <a href="http://www.cdwow.ie/feature.php?list_id=685" style="color:#FF9900"> CDs under €7!</a> Should that be <a href="CD7.php" style="color:#FF9900"> CDs under €7!</a> CD7 <?php include("adminconnect.php"); $id = $_GET['id']; $sql = "SELECT * FROM product WHERE Price <= '7'"; $res = mysql_query($sql) or die(mysql_error()); // Since you are getting only one row no neew to loop $row = mysql_fetch_assoc($res); // now just echo all your fields below and format it the way you like echo "Title: ".$row['ProductName']."</a>\n<br> <img src=\"".$row['Image']."\"></img>\n<br> Price ".$row['Price']."\n<br> Description: ".$row['Description']."\n<br>"; ?> Link to comment https://forums.phpfreaks.com/topic/100547-listing-cds-under-a-certain-price/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.