Jump to content

Listing CD's under a certain price


mikebyrne

Recommended Posts

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 &#8364;7!</a>

 

Should that be

 

<a href="CD7.php" style="color:#FF9900"> CDs under &#8364;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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.