<?php
mysql_connect("localhost","root","myPassword");
mysql_select_db("itemDatabase");
$price=120;
$pricemin=$price-$price/10;
$pricemax=$price+$price/10;
echo $pricemin.$pricemax;
$query=mysql_query("SELECT * FROM itemlist WHERE price<$pricemax AND price>$pricemin");
while($row=mysql_fetch_array($query))
{
echo "$row[name] -$row[price]<br>";
}
?>
|