<?php
$login=mysql_connect("localhost","wauhaha_smart",'asd123');
mysql_select_db("wauhaha_smart");
$budget=$_REQUEST['budget'];

$q=mysql_query("SELECT * FROM product INNER JOIN company ON company.id = product.companyID ORDER BY product.price ASC ");
    while($display=mysql_fetch_array($q)){
	   
	$price=(int)$display['price'];
	
	if($price<=$budget){
		$output[]=$display;
	
	}
	
				
	}
     

print(json_encode($output));

mysql_close();
?>