Forums

This topic is locked

query database then send results in email with cro

Posted 28 Mar 2008 07:37:53
1
has voted
28 Mar 2008 07:37:53 Shannon Smith posted:
Hi

Does anyone know of an extension which can acheive some of this.....

I am wanting to use a cron job to execute a php script to automatically query a MYSQL database then email the result to a user(s) in a DB. I am suing a LAMP stack. This is for a HR management system which does not have all the functions i need (orange HRM open source if you have heard of it) I have several of these scripts to set up but perhaps the easiest one woulde be

querying a databse to find when a emploees details were last updated and if it has not been in the last 60 days then they are sent an email

The main issue is i have never written a script like this before and after looking everywhere on the web cant find a good solution. Can someone please help?

Replies

Replied 28 Mar 2008 12:15:43
28 Mar 2008 12:15:43 Alan C replied:
HI
I've not done that but I did set up sendstudio for a client - that uses cron jobs to schedule sending emails, including breaking the list down so it keeps within server limits. The hardest thing was setting up the cron jobs using cpanel, because my hosting provider seemed to have disabled part of the cron setup, so it looked like I had set up the jobs but they never ran. Once that was sorted out things went very well

I'd suggest getting your script working with manual activation then once you are happy with that move onto the cron job.

Do you have the query etc already for checking things like the 60 days? - if not using a unix time based on seconds works very well - sorry if I'm suggesting things you already got sorted <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Reply to this topic