When I enter only min value then it consider max as zero and return me null data
$min=$_REQUEST['min'];
$max=$_REQUEST['max'];
$q3="select * from product where '$min' < `price` < '$max'";
$q=mysql_query($q3);
When I enter only min value then it consider max as zero and return me null data
$min=$_REQUEST['min'];
$max=$_REQUEST['max'];
$q3="select * from product where '$min' < `price` < '$max'";
$q=mysql_query($q3);
If you do not provide value in your request, php will consider it as NULL. You should have to provide value every time or you can do this .
$min=$_REQUEST['min'];
$max=$_REQUEST['max'];
if(!$max){
$max = 45; // or what ever value you like
}
$q3="select * from product where price > '$min' and price < '$max' ";
$q=mysql_query($q3);
Change the query by max value:
$min=$_REQUEST['min'];
$max=$_REQUEST['max'];
if( empty($max) )
$q3="select * from product where price > '$min'";
else
$q3="select * from product where price > '$min' and price < '$max' ";
$q=mysql_query($q3);
One more correction you should start using PDO . method your are using is depreciated.