<?php
include ("connect.php");
$result2 = mysql_query("SELECT * FROM supplier WHERE stock_name='".$_POST['stock_name']."'");
$line = $db->queryUniqueObject($query2);

$supName=$line->supName;

if($line!=NULL)
{
$line1 = $db->queryUniqueObject("SELECT * FROM stock_avail  WHERE name='".$_POST['stock_name']."'");
$quantity=$line1->quantity;
$arr = array ("category"=>"$category","supplier"=>"$supplier_id","buyingrate"=>"$company_price","sellingprice"=>"$selling_price","available"=>"$quantity");
echo json_encode($arr);

}
else
echo "no";
?>