$result = $sql->query("SELECT * FROM datetime WHERE date='2014-05-24'");
while ($row = $result->fetch_assoc()) {
$times[] = $row;
}
echo json_encode($times);
$.ajax({
type: 'POST',
url: '/function/checkTime.php',
data: ({date: date}),
dataType: 'json',
success: function(data) {
/* тут обрабатываете ответ */
}
});
$param = mysql_escape_string(htmlspecialchars(strip_tags($_GET['param'])));