date = "2014-05-21";
jQuery.ajax({
type: "POST",
url: "/function/checkTime.php",
data: ({date:date}),
dataType:"text",
success:
// Code;
// Собираем дату;
$date = $_POST['date'];
//Запрос к базе;
$times= $sql->query("SELECT * FROM datetime WHERE date='$date'")->fetch_array();
jQuery.ajax({
type: "POST",
url: "/function/checkTime.php",
data: ({date:date}),
dataType:"json",
success: function(response) {
// тут обрабатываем
}
// Собираем дату;
$date = $_POST['date'];
//Запрос к базе;
$times= $sql->query("SELECT * FROM datetime WHERE date='$date'")->fetch_array();
echo json_encode($times);
echo json_encode($times);
$.ajax({
type: 'POST',
url: '/function/checkTime.php',
data: ({date: date}),
dataType: 'json',
success: function(data) {
/* тут обрабатываете ответ */
}
});
echo json_encode($times);
jQuery.ajax({
type: "POST",
url: "/function/checkTime.php",
data: ({date:date}),
dataType:"text",
success: function(data) {
console.log(data);
}
});
{"0":"1","id":"1","1":"2014-05-24","date":"2014-05-24","2":"16:00","time_start":"16:00","3":"17:00","time_end":"17:00"}