Welcome Guest, Not a member yet? Register   Sign In
Continuous XML fetching...

I have just started using code igniter, and I am already getting on very well with it, due to my past experience in a wide array of languages!
There is one thing I don't know how to go about doing, both with code igniter and in PHP.

I simply want to fetch an XML file every xx seconds, which will in my case then input the data from the XML into a database.
I don't know if there is a main loop, or where should I make one. I have no idea how to go about this!
Any suggestions will be appreciated! Thanks

Use a cron job?

There is no main loop in PHP. As an interpreted language, a PHP script only runs until it finishes the task. It doesn't keep running indefinitely. You'll need to setup a cron job (if you're on a *nix system) or a scheduled task (if you're on a windows system).


What about an AJAX call into a setTimeout?

[eluser]GSV Sleeper Service[/eluser]
cron is the way to go. this didn't really need saying, but I needed an excuse to comment on Symcrapico's avatar! Bob Ross was da man! RIP Bob

Theme © iAndrew 2016 - Forum software by © MyBB