Sir I have these codes
<script>
function myCall() {
var date_filter = $("#datepicker-13").val();
alert(date_filter)
var request = $.ajax({
url: "ajax_arrival.php",
type: "Get",
date: date_filter,
dataType: "html"
});
request.done(function(msg) {
$("#wh_bg1").html(msg);
alert(msg);
});
request.fail(function(jqXHR, textStatus) {
alert("Request failed: " + textStatus);
});
}
</script>
In above codes
alert(date_filter)
says: 29-08-2016
It means this funciton is getting DATE from FORM.
and here ajax_arrival.php for processing
<?php
include_once("includes/connectw.php");
$query ="SELECT * FROM arrival WHERE date='date_filter'";
$result=mysqli_query($con, $query);
if ($result){
$row = mysqli_fetch_array($result);
$res=$row['qty']."##".$row['weight'];
echo $res;
}
?>
when I run function myCall()
then it says:
Undefined constant date_filter
why the value of date_filter is not going to ajax_arrival.php?
or is there anyother mistake?
Please help