daily automated query of database

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Dear All,

I would like to run a script on a daily basis that queries a DATE field
in one of my tables. I want to do this to establish the age of my table
entry by comparing with the current date.

Could someone please give me a few pointers on how to get started in
solving this. I just read somewhere about cron jobs but I've never used

I'm running Apache (2.0.54) on Win XP Prof with MySQL (4.1.10) and PHP
(4.3.10). All on a local machine so I can set all appropiate

Many thanks, John

Re: daily automated query of database

On Πεμ, 18 Αύγ 2005 at 12:25 GMT, braders00 wrote:
Quoted text here. Click to load it

At first try calling your script from a DOS window using php.exe
For example [1]:
c:\tmp> php -f myscript.php

and check the output. If it's OK, create a repeating job with
any job scheduler (like nnCron Lite [2]) and set the output
to be emailed to your account.

Cron is just a service which enables a user to create jobs
that repeat as scheduled.


[1] Since I'm using only Unix systems, I don't know the exact
    syntax of the command in DOS/Windows. Try "php --help" or
    "php -h" to see how you can call a script from command

[2] http://www.freewareweb.com/cgi-bin/archive.cgi?ID=1651

Replace earth.space with gmail.com for a valid e-mail

Re: daily automated query of database

braders00 wrote:

Quoted text here. Click to load it
There's no cron in Windows. Use the Windows task scheduler instead  
(Start - All Programs - Accessories - System Tools - Scheduled Tasks).

My Run command looks like this:
c:\apache\php\php.exe C:\apache\htdocs\my script.php
(That's the full path to the php executable followed by the full path to  
the script).

I also have it set to - Start in: folder c:\apache\php

 Chuck Anderson • Boulder, CO
 Integrity is obvious.
 The lack of it is common.

Re: daily automated query of database

i solved the problem with Windows task scheduler - works great.

thanks guys.

Site Timeline