Jump to content

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

Recommended Posts

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

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...