Navigate
Home
ArticleWiki
Forum
Journal
Search
Newsletter
Links
Tech News
expertsrt.com
Welcome Guest.
Username:

Password:

Remember me

Scheduling a php script to run daily to insert data into a MySql database
Welcome, Guest. Please login or register.
January 09, 2009, 07:00:16 AM
11313 Posts in 1251 Topics by 508 Members
Latest Member: pissematbox
Experts Round Table Network  |  Serverside Technology  |  PHP  |  Scheduling a php script to run daily to insert data into a MySql database « previous next »
Pages: [1]
Author Topic: Scheduling a php script to run daily to insert data into a MySql database  (Read 1066 times)
ardgehaneshark

Offline Offline

Posts: 1


« on: May 10, 2007, 09:32:27 AM »

Hey there, ardgehaneshark needs help?

Got a problem scheduling a php script to run daily which inserts data from a newspaper website into a MySql database! Firstly, I know my script works because a can call it from my browser and the data is inserted into the database. I have tried using Windows Task Scheduler to do so but one of 2 things happen. In one instance Task Scheduler shows the status of the task as 'Could not start'. In the second instance the task runs and both a browser session is opened and a shell is also opened. But here is the problem, nothing happens.

Can anyone help, please!!!!?????
Logged
VGR
Mentor

Offline Offline

Posts: 684



WWW
« Reply #1 on: May 10, 2007, 09:51:43 AM »

the AT command is the equivalent to the scheduler you tried. You could make the script log to a text file what's happening in it. You probably have a path/argv problem. Using the CLI mode on Windows is IMHO more difficult than on unix.

that's why I created many years ago my RobotOuaibe program (freely available) : I use it to launch whenever I want regular
(daily) tasks, including local scripts by just launching http://localhost/thescript

It's available from the third party tools on http://www.edainworks.com and use it if it saves you some debugging pleasure ;-)
Logged

techie overlord, answers all kind of questions on http://www.europeanexperts.org
mishkad

Offline Offline

Posts: 15


« Reply #2 on: June 10, 2007, 02:14:27 AM »

Hi, its kind of late but anyway.....
With regards to the problem to run task via Windows task scheduler:
I'm 100% sure that when you defined the task in task  scheduler the system asked you for password account with and You hadn't not set the answer.  For that reason the task coudn't start.
So to make it work do following:
1) Check "Run only if logged in" (so yes don't logged out)
2) Initiate scripts from batch file and redirect results to log text file using  ">" or ">>" to append - this wil resolve annoying problem of console window from appearing (as recomended by Mr.V).

Cheers
M.D.
Logged
Pages: [1]
« previous next »
    Jump to: