I have this code below on how to show who is currently "on leave" today.
$today = date("j F, Y");//date format is->1 December, 2015
$result = $db->query("SELECT name, date_apply, leave_from, leave_end, num_days, reason FROM applied_user WHERE status = 'Approved' AND leave_from = '$today'");
My question is, is it possible to show all approve leave before the current day?thanks..
Try this
$today = date('d F, Y'); //current date (11 December, 2015)
$result = $db->query(
"SELECT name, date_apply, leave_from, leave_end, num_days, reason
FROM applied_user
WHERE status = 'Approved'
AND leave_from >= '$today'");