<?php

require_once("../config/configDB.php"); 

$btype    = $_GET['btype'];

$result = mysqli_query($conn,"SELECT DISTINCT  brand_name, id   FROM brand_master WHERE brand_type LIKE '".$btype."' and  isdelete=1  ");
$result = mysqli_query($conn,"SELECT DISTINCT  brand_name, id   FROM brand_master WHERE brand_type LIKE '%".$btype."%' and  isdelete=1  ");
//print_r($result);die;
$res = array();		
while($row = mysqli_fetch_array($result)){

    array_push($res, array(
        "id"=>($row['id']),
        "brand_name"=>($row['brand_name'])
    ));

}

echo json_encode($res);



//$row_cc = mysqli_fetch_array($sql);
//$rowcc=mysqli_fetch_array($sql,MYSQLI_ASSOC);
//echo $rowcc;

// $res = array();		
// while($row = mysqli_fetch_array($result)){
	
// 	$sql = mysqli_query($conn,"SELECT sum(amount) as amount  FROM collection_customer WHERE customerID='".$cid."' and saleID='".$row['saleBillNo']."' ");

// 	$row_cc = mysqli_fetch_array($sql);

// 	if($row_cc['amount'] < $row['tamount'] ) {
	
// 		array_push($res, array(
// 				"saleBillNo"=>($row['saleBillNo'])
//         	) 
// 		);
// 	}
// }
// 	echo json_encode($res);

?>