I have this query that looks for birthdays of the month:
$mesHoje = date("m");
$sqlAni = $pdo->prepare('SELECT * FROM aniversario WHERE MONTH(dia) = :mesHoje ORDER BY dia ASC');
$sqlAni->execute(array("mesHoje" => $mesHoje));
How do I order for today? Example (today is 23), then the dates below:
07/10/1928
12/10/1987
15/10/2012
24/10/1942
30/10/1999
They would be in this order (note that the first date is 24, because it is the closest date today, which is 23):
24/10/1942
30/10/1999
07/10/1928
12/10/1987
15/10/2012
I can not take into consideration the year, just the day.