mysteriousmonkey29

how to run scheduled PHP script that remembers variables from the last run?

3 posts in this topic

Hello, I am currently working on a PHP program that uses an RSS reader to update a MySQL database with comic information from various web comics. After some research, it seems like it would be a better idea to do this using a Cron job or something similar, as opposed to just a sleep loop within PHP. However, my script needs to pass information to itself from the last time it was run. I want it to compare information taken from each RSS page from the last time it ran to see if the page is updated, then only to add information to the database if it has indeed been updated. Unfortunately, I'm not sure how to do this/if this is even possible using a Cron job or Windows task scheduler (I am currently developing on Windows).

 

Any idea how to solve this problem? I suppose I could just use a sleep loop as I was originally considering, but I have read in various locations that this is apparently a very glitchy and unreliable way of doing what I want to do, so I would like to avoid it if possible.

 

Thanks in advance

Share this post


Link to post
Share on other sites

Either store your data in a database, or a file.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now