Page 1 of 1
Can PHP do this?
Posted: Thu Aug 10, 2006 7:46 am
by jmilane
If I wanted to execute sql statements (reports) on a nightly basis and have the results formatted and emailed to specific people, is php capable?
Thank you... all I am looking for is an idea of how difficult this would be and what kinds of things are involved.
Regards,
J
Posted: Thu Aug 10, 2006 7:54 am
by Ambush Commander
As long as your system has cron or some similar variant, yes, this can be done with PHP in cli.
Posted: Thu Aug 10, 2006 7:56 am
by jmilane
Ambush Commander wrote:As long as your system has cron or some similar variant, yes, this can be done with PHP in cli.
Its a Windows system.
Whats cli?
Posted: Thu Aug 10, 2006 7:56 am
by blackbeard
You can use PHP to create the code that creates the report, but in order to run it on a schedule, you need to set up a cron job that calls the script, if you're in a linux/unix environment.
If you're running on a windows box, you can use the Task Scheduler to run the script (I've never used it, don't even know for a fact if it's different or even available on a windows server.)
Posted: Thu Aug 10, 2006 7:56 am
by dreamline
CLI = Command Line Interface
I'm using CRON every night to run certain scripts (i'm using a linux machine)..

Never tried the windows task scheduler for that purpose though...

Posted: Thu Aug 10, 2006 7:58 am
by jmilane
blackbeard wrote:You can use PHP to create the code that creates the report, but in order to run it on a schedule, you need to set up a cron job that calls the script, if you're in a linux/unix environment.
If you're running on a windows box, you can use the Task Scheduler to run the script (I've never used it, don't even know for a fact if it's different or even available on a windows server.)
I dont know about the Task Scheduler running php scripts...
...so the consensus is - it can be done without too much hassle or advanced skillsets?
Posted: Thu Aug 10, 2006 8:03 am
by litebearer
Yes , easy to do with a task scheduler.
Have the task scheduler start the browser (pointed to the appropriate script)
Posted: Thu Aug 10, 2006 8:14 am
by feyd
icron. Better and more reliable than task scheduler.
Posted: Thu Aug 10, 2006 8:19 am
by jmilane
feyd wrote:icron. Better and more reliable than task scheduler.
Thanks a lot. Please dont charge me for that. I didnt know you were so expensive.
Posted: Thu Aug 10, 2006 8:20 am
by s.dot
jmilane wrote:feyd wrote:icron. Better and more reliable than task scheduler.
Thanks a lot. Please dont charge me for that. I didnt know you were so expensive.
His answers on the forums are completely free of charge. =] And 100% correct.
Posted: Thu Aug 10, 2006 8:20 am
by Oren
jmilane wrote:feyd wrote:icron. Better and more reliable than task scheduler.
Thanks a lot. Please dont charge me for that. I didnt know you were so expensive.
Edit: It reminds me a joke... It goes like this:
"You're a high priced lawyer!
If I give you $500, will you answer two questions for me?"
"Absolutely! What's the second question?"
Now I can make a comparison between
feyd and the lawyer (that would be funny

):
lawyer - charges $500 for 2 questions
feyd - charges $500 for 2 hours
Posted: Thu Aug 10, 2006 8:49 am
by panic!
how was icron compare to real cron?
Posted: Thu Aug 10, 2006 8:52 am
by feyd
roughly, it's a port of it from *nix to a windows service.