0
내가 예약 할 수있는 예약 양식이 있는지 확인하십시오. 날짜를 사용할 수 있는지 확인하기 위해이 작업을 수행 할 수 있었지만 문제가 발생하여 시간이 반영되지 않았습니다. Jquery Ajax - 날짜 및 시간 가용성 확인
이
내가 JQuery와/아약스에서 확인 할 방법은 다음과 같습니다$(document).ready(function(){
$("#time_select_2_hour").change(function(){
$("#availability_1").html("<img src='ajax-loader.gif' /> checking...");
var date1=$("#date1").val();
var time_select_2_hour=$("#time_select_2_hour").val();
$.ajax({
type:"post",
url:"check.php",
data:"date1="+date1,
data:"time_select_2_hour="+time_select_2_hour,
success:function(data){
if(data==0){
$("#availability_1").html("<img src='tick.png' /> Tour is available!");
}
else{
$("#availability_1").html("<img src='cross.png' /> Tour is fully booked, please choose another date or tour time.");
}
}
});
});
});
을 그리고 이것은 check.php
$date1=$_POST["date1"];
$time=$_POST["time_select_2_hour"];
$query=mysql_query("SELECT * from bookings where date1='$date1' AND time ='$time'");
$find=mysql_num_rows($query);
echo $find;
그것은 오류를 던지고 아니에요, 그것은 단지 항상 "사용 가능한"말한다 해당 조합이 이미 예약 된 경우에도 마찬가지입니다.
코드의 일부 prblms –