joshuaer Posted June 20, 2012 Share Posted June 20, 2012 Hello I have a forum that members fill out to have reminders sent to them on certain days that I am working on. I am trying to figure out how to make these reminders only send out on the days the members specify in the forum is there a way that the cron job can run check the days stored in mysql database against the current day and then if it is suppose to send that day send out the reminder? Thanks Link to comment Share on other sites More sharing options...
birbal Posted June 20, 2012 Share Posted June 20, 2012 cron job is just a schedule task which runs periodicaly to execute certain scripts. The script will be a usual php script which can do anything you want them to do. you can query the DB from the script and do certain task. Link to comment Share on other sites More sharing options...
joshuaer Posted June 22, 2012 Author Share Posted June 22, 2012 Would I create a if statement so if the current day matches the day in the database it would trigger the sendmail action? Link to comment Share on other sites More sharing options...
birbal Posted June 22, 2012 Share Posted June 22, 2012 if your date time is stored as timestamp you have to create a timestamp range and check against database which entries comes between this. if it is date time object in DB you can use several date functions in php to find the matches. Link to comment Share on other sites More sharing options...
joshuaer Posted June 24, 2012 Author Share Posted June 24, 2012 Thanks for the reply birbal, if you cant already tell I am fairly new to php and mysql. do you have an example of this I can look at or maybe a link to a website that has an example. I have beel looking around for several days and cannot quite seem to find what I am looking for Thanks again Link to comment Share on other sites More sharing options...
birbal Posted June 24, 2012 Share Posted June 24, 2012 if you have come up with any code that will be better to work forward from that. and how is your dates stored in db? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now