473,405 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

daily automated query of database

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
them?

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
permissions.

Many thanks, John

Aug 18 '05 #1
3 1707
On Ðåì, 18 Áýã 2005 at 12:25 GMT, braders00 wrote:
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
them?

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
permissions.


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.

Apostolos
[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
line.

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

--
Replace earth.space with gmail.com for a valid e-mail
Aug 18 '05 #2
braders00 wrote:
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
them?

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
permissions.

Many thanks, John

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
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*****************************
Aug 18 '05 #3
i solved the problem with Windows task scheduler - works great.

thanks guys.

Aug 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Konstantin Zakharenko | last post by:
Hello, Our QA team have running a lot of test scripts (for automated regression testing), they run them on the different databases (Oracle/MS SQL). Several of those tests are dependent on the...
5
by: FoxRunner | last post by:
Hi folks, I got a script which restores a database. It works fine if it is running in my Query Analyzer. It fails when I put this script in an automated schedule using the SQL agent. This...
4
by: Civilian_Target | last post by:
Is there any way in DB2 to automate the taking of a snapshot, for example, a function that will cause a db2 snapshot to be taken every 5 minutes and written to a uniquely named file? Am I better...
1
by: DSmith | last post by:
I have a quality control database containing data for samples pulled every four hours (several years worth of data). What I need to do is find the maximum value for a field for each eight hour...
1
by: gpaille | last post by:
I got a big Access database I'd like to convert to MS SQL Server 2000 and I'm looking for an efficient automated tool to convert data (over 1 400 tables), query, forms and interface. Does...
0
by: Tom van Stiphout | last post by:
This was such a great help against spam: one could always point out to an ISP that our charter was posted every day under "New Users Look Here First", and that the poster violated every rule in...
3
by: Richard Gilmore | last post by:
within my database I have a login form with a forgot password button when the button is clicked you are prompted to enter your email in frmforgotpassword this value is used for the parameters of...
6
by: bmjnine | last post by:
Hi all, I am trying to setup a daily task in my .NET (1.1) application. The application is a project management tool, and the daily task I am trying to set up will check for overdue project...
1
by: lanlife | last post by:
Hello All, I am building an application which i will like to send an automated sms through a gateway to gsm phone numbers.I want it to query the database to get data at a particular time and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.