Assuming you have a table called users with birthday as bday for the column name, this will pull all users who are having a birthday in the next 7 days. This is very useful if you want to showcase your member’s birthdays on your website.
1 |
SELECT * FROM `users` WHERE DAYOFYEAR(curdate()) <= dayofyear(`bday`) AND DAYOFYEAR(curdate()) +7 >= dayofyear(`bday`) LIMIT 30; |
There is of course one small problem with this, […]