Hi
how would i search for the lowest price and category
here is the code i have
$query = "select category,name, MIN(price) from products where name like '%$q%' GROUP BY name ";
$result = mysql_query($query) or die(mysql_error());
// Print out result
while($row = mysql_fetch_array($result)){
echo "The cheapest ". $row['name']. " is $" .$row['MIN(price)'];
echo "<br />";
}
when i use the search form it fetches all items in the database, if i type in bread i want all items in the bread category at the lowest price.
thanks