Can PHP do this?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jmilane
Forum Commoner
Posts: 89
Joined: Mon Aug 07, 2006 6:05 pm

Can PHP do this?

Post 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
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

As long as your system has cron or some similar variant, yes, this can be done with PHP in cli.
jmilane
Forum Commoner
Posts: 89
Joined: Mon Aug 07, 2006 6:05 pm

Post 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?
blackbeard
Forum Contributor
Posts: 123
Joined: Thu Aug 03, 2006 6:20 pm

Post 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.)
dreamline
Forum Contributor
Posts: 158
Joined: Fri May 28, 2004 2:37 am

Post by dreamline »

CLI = Command Line Interface :)

I'm using CRON every night to run certain scripts (i'm using a linux machine).. :D Never tried the windows task scheduler for that purpose though... :)
Last edited by dreamline on Thu Aug 10, 2006 8:00 am, edited 2 times in total.
jmilane
Forum Commoner
Posts: 89
Joined: Mon Aug 07, 2006 6:05 pm

Post 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?
litebearer
Forum Contributor
Posts: 194
Joined: Sat Mar 27, 2004 5:54 am

Post by litebearer »

Yes , easy to do with a task scheduler.

Have the task scheduler start the browser (pointed to the appropriate script)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

icron. Better and more reliable than task scheduler.
jmilane
Forum Commoner
Posts: 89
Joined: Mon Aug 07, 2006 6:05 pm

Post 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.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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.
:lol:

His answers on the forums are completely free of charge. =] And 100% correct.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post 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.
:lol: :lol: :lol:

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 :P):

lawyer - charges $500 for 2 questions
feyd - charges $500 for 2 hours
User avatar
panic!
Forum Regular
Posts: 516
Joined: Mon Jul 31, 2006 7:59 am
Location: Brighton, UK

Post by panic! »

how was icron compare to real cron?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

roughly, it's a port of it from *nix to a windows service.
Post Reply