I have a HTML table that displays a bunch of reporting data from a sql table. Right now the query defaults to the current date, but I'm looking for the most efficient way to change the start/end date variables and refresh the page. My query now looks like this:
$sts = date('Y-m-d');
$ets = date('Y-m-d', time()+86400);
$q = "SELECT * FROM data WHERE `ts` BETWEEN '$sts' AND '$ets'";
I've then created basic HTML selects to choose a new date range, and on the form submit it'll store all of that information in POST. What is the most simple way of changing that $sts and $ets variable to reflect the post information? I'm kind of guessing that it will be to make the form action 'index.php', and handle the variable change using AJAX. But tbh I'm not sure.
Thank you for the help!
ts
> '2013-08-03 00:000:00' ANDts
< DATE_ADD('2013-08-03 00:000:00', INTERVAL 1 HOUR);sts
,ets
ts
andq
may make sense to you, but future developers will thank you for using names that they can understand.