<?php
 $srch=''; 
 if(isset($_POST['srch']) || !empty($_POST['srch'])){
	 $srch=_caracterborra($_POST['srch']);
 }
 else{
	 exit;
}
 $srch_sql='select item_codigo,item_descri from item0 where item_descri like "'.$srch.'%"  limit 5';
 //echo $srch_sql;
 $srch_res=$lynk_demo->query($srch_sql);
 $jsn='';
 if(mysqli_num_rows($srch_res)!=0){
	 $r=1;
	  $jsn.='{"error":"0"';
	 
	 while($srch_r=mysqli_fetch_assoc($srch_res)){
		 $jsn.=',"r'.$r.'":"'.$srch_r['item_descri'].'"';
		 $r++;
	 }
	 $jsn.='}';
	echo $jsn;
 }
 if(mysqli_num_rows($srch_res)==0){
 	echo '{"error":"1","r1":"-"}';
 }

?>