I have a mysql database of members and the money they owe. I would like to send an email to a member if they owe x amount for longer than x days...
any suggestions
any help MUCH appreciatedyou can do a cron job running a command line php script...I don't seem to have the privilege to run cron on my server...
any other suggestions?Well without something like Cronjobs running, a way you could do it is, have your page whenever it's loaded check how many days it has been since your last email then email out, assuming your page is busy during the day, it should get activated by a user coming through.
That's a hacked way to do it though, I really suggest something like Cronjobs. I use the former method to clean out my shoutbox's database after a certain amount of posts though.
Depending on how large the result of the query is though, it could slow down the loading time for that user.well that sounds like my only option...
how would I check when the email was last sent? would I need to set up another database to remember??Originally posted by nads1982
well that sounds like my only option...
how would I check when the email was last sent? would I need to set up another database to remember??
I don't know how your table is setup but on your one with how much they owe, just add a field to hold the date you last sent.
Then when you query the database query it to pull only the rows that have dates x amount of days ago and back. Then just update that field for the date with today's(the day you did the query) date and they won't be pulled from the query until another x days passes.
any suggestions
any help MUCH appreciatedyou can do a cron job running a command line php script...I don't seem to have the privilege to run cron on my server...
any other suggestions?Well without something like Cronjobs running, a way you could do it is, have your page whenever it's loaded check how many days it has been since your last email then email out, assuming your page is busy during the day, it should get activated by a user coming through.
That's a hacked way to do it though, I really suggest something like Cronjobs. I use the former method to clean out my shoutbox's database after a certain amount of posts though.
Depending on how large the result of the query is though, it could slow down the loading time for that user.well that sounds like my only option...
how would I check when the email was last sent? would I need to set up another database to remember??Originally posted by nads1982
well that sounds like my only option...
how would I check when the email was last sent? would I need to set up another database to remember??
I don't know how your table is setup but on your one with how much they owe, just add a field to hold the date you last sent.
Then when you query the database query it to pull only the rows that have dates x amount of days ago and back. Then just update that field for the date with today's(the day you did the query) date and they won't be pulled from the query until another x days passes.