my ajax file returns value on my local host but when I uploaded it on live server it returns an empty array.
(我的ajax文件在本地主机上返回值,但是当我将其上传到实时服务器上时,它返回一个空数组。)
this is what's inside the file my ajax/jquery calls
(这是我的ajax / jquery调用的文件里面的内容)
include '../../components/db.php';
$res_date = $_POST['res_date'];
$query = "SELECT t.timeasd from time t left join (select time_reserved, date_reservation from RESERVATIONS where date_reservation = '$res_date') as q on t.timeasd = q.time_reserved where q.date_reservation is null AND t.status='active'";
$result = mysqli_query($conn, $query);
$timeslots=array();
while ($myrow=mysqli_fetch_assoc($result))
{
$timeslot=$myrow['timeasd'];
array_push($timeslots,$timeslot);
}
echo json_encode($timeslots);
it worked when I changed the query to
(当我将查询更改为)
SELECT * from time
but I am using the former query on my localhost database and it works perfectly
(但是我在我的本地主机数据库上使用前一个查询,它运行完美)
ask by reve berces translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…