|
Posted by Tom on 07/23/07 18:36
On Sat, 21 Jul 2007 19:08:28 +0200, Michael Fesser wrote...
>
>.oO(Reapes)
>
>>I have a script to remind me on certain days of things.
>>
>>The script allows a date of the reminder to be set as well as the number
>>of days prior to the date to be reminded on via email.
>>
>>I am new to php so be gentle with my code (lol)
>>
>>Basically what I need to do is check the reminder date (called date in
>>my mysql table) against todays date (only the month and day as the year
>>is not used due to it going to be a year on year event) factoring in the
>>number of days (reminderdays) prior to the date you want reminded of.
>
>Let the database do it. Store the event dates in a DATE column. Then use
>MySQL's date and time functions to return all events where the current
>date is somewhere within the "reminding range".
>
>Micha
Absolutely. It's a lot easier letting your SQL database do the work for you. You
can add a simple date range to your WHERE clause instead of trying to analyze
the results with PHP code. Since you already have a query being sent to the
database, you can just fine tune your results.
Tom
--
Newsguy Takes Usenet Cellular!
Download your favorite photos, songs or movie files
Send the files or links your cell/PDA
http://newsguy.com/cellphone.htm
Navigation:
[Reply to this message]
|