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

$q=mysql_query("SELECT * FROM product WHERE pName like '%".$_REQUEST['product']."%'  AND product.status='available' ORDER BY pName ASC ");
	$int=0;
    while($e=mysql_fetch_assoc($q)){
	
	
	if($int==4){
		break;
	}
	
	
	$output[]=$e;
	$int++;
	}
        

print(json_encode($output));

mysql_close();
?>