<?php 
include 'conn.php';
$data = [];
 
 
$desc = "Select user.*,roles.role_name FROM users as user
INNER JOIN roles ON roles.id=user.role 
";
$descRes = $mysqli->query($desc);
while($rowDesc = mysqli_fetch_array($descRes)){
   if($rowDesc['status']==1){
      $rowDesc['status'] = 'Active';
   }else{
      $rowDesc['status'] = 'In Active';
   }
 $data[] =  $rowDesc;

}
 if(count($data)>0){
    $response['status'] = true;
    $response['response'] = "Data Exist";  
    $response['data'] = $data;  
    die(json_encode($response));
 }else{
    $response['status'] = false;
    $response['response'] = "No Data Exist";  
    die(json_encode($response));    
 }

 


?>