<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: X-Requested-With');
header('Access-Control-Allow-Methods:GET');
if($_SERVER['REQUEST_METHOD']=='GET')
{
$username = $_GET['username'];
$status = $_GET['status'];
require_once('dbConnect.php');
if(!empty($username))
{
if(empty($status))
{
$sql = "SELECT * FROM ticketdetails WHERE (Status != 'Close' or Status != 'H/W_prob')
and cancel !='ok' and person='".$username."'";
}
else
{
$sql = "SELECT * FROM ticketdetails WHERE cancel !='ok'
and status= '".$status."' and person='".$username."'";
}
$r = mysqli_query($con,$sql);
$result = array();
while($res = mysqli_fetch_assoc($r))
{
$a[]=$res;
$result['data']=$a;
}
}
else{
$result['status'] = "false";
}
echo json_encode($result);
mysqli_close($con);
}
when I check this api I got empty result in output , I have Two server one live and test this api work properly on test server and also locally on wamp but when I upload this script into live I show empty result anything wrong or what i cant understand.....