content.php
$(document).ready(function(){
var srt=$("#cal1Date1").val();//start date
var end=$("#cal1Date2").val();//end date
$.ajax({
url:"http://localhost/show.php",
data: {srt:srt,
end:end
},
type:"POST",
dataType: "json",
complete:function(response){
console.log(response.responseText);
}}); })}
the above code is sends the data to show.php which queries the date range
show.php
include_once "connector.php";
$sql = "SELECT * FROM `testtable` WHERE `Request Date` BETWEEN 'start date' AND 'end date' " ;
$result = mysqli_query($db,$sql);
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result)) {
echo $row["Order ID"]; }
mysqli_close($db);
?>
and the above code filters the result by the date range we provided. it prints all the filtered 'Order Ids'
now I want to know is how can I send all these order id back to content.php? so i can manipulate the data there.