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

[eluser]Unknown[/eluser]
Hi,
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
#2

[eluser]Kemik[/eluser]
Use a cron job?
#3

[eluser]bradym[/eluser]
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).

Brady
#4

[eluser]Symcrapico[/eluser]
What about an AJAX call into a setTimeout?
#5

[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