<?php
header ('Content-Type: application/json');
header('Acess-Control-Allow-Origin: *');
header('Acess-Control-Allow-Methods: Post');



include 'confing.php';

$data=json_decode(file_get_contents("php://input"),true);

$tableName=$data['table'];
$conditon_1=$data['condition1'];
$conditon_2=$data['condition2'];

$colom_1=$data['coloum'];
$colom_2=$data['coloum2'];


$sql="SELECT * FROM `$tableName` WHERE `$colom_1` = '$conditon_1'
AND `$colom_2` = '$conditon_2'";

// echo $sql;


// $sql = "SELECT * FROM {$tableName} WHERE {$colom} = {$retailerid} AND {$colom_2} = {$condition_2}";




$result=mysqli_query($conn,$sql) or die("error while".$sql);


if(mysqli_num_rows($result)>0){

	while($row=mysqli_fetch_array($result, MYSQLI_ASSOC))
    {
         $ouput[]=$row;

      
          }
    
  
    echo json_encode(array('list'=>$ouput,'status'=>'1'));

   

}else{

    echo json_encode(array('status'=>'0'));

}


?>