<?php 
include("inc/config.php");


   $searchText = $_POST['search'];
   	$statement = $pdo->prepare("SELECT * FROM tbl_hsncode where hsncode like '%".$searchText."%' order by id asc limit 10");
									$statement->execute();
									$result = $statement->fetchAll(PDO::FETCH_ASSOC);
									$count = $statement->rowCount();
									
									 $search_arr = array();
                                     foreach ($result as $row) 
                                     {
                                            $id = $row['id'];
                                            $hsncode = $row['hsncode'];
                                            $igst = $row['igst'];
                                            $cgst = $row['cgst'];
                                            $sgst = $row['sgst'];
                                            $search_arr[] = array("id" => $id, "hsncode" => $hsncode, "igst" => $igst, "cgst" => $cgst, "sgst" => $sgst);
                                     } 
                                    echo json_encode($search_arr);
?>