peterbz Posted April 22, 2008 Share Posted April 22, 2008 I have 2 questions. 1st Question: I was wondering how you can schedule PHP scripts to run at a given interval to update a MySQL database. I want the script to update 3 remote MySQL database one after another. However, how do I detect and check when each one is finished before moving on to another one. 2nd Question: I have a form that a user has to fill out. After he fills it out, I want to send him to a report screen. However, I have another script that deals with updating and retrieving data from database that may require some time to finish executing. How do I send the user to the report screen and also have the script running in the background after the user clicks Submit. Of course, I can just send the browser straight to the script and wait until it is done before redirecting to the report screen, but what if the user refreshes the page? Link to comment https://forums.phpfreaks.com/topic/102416-2-questions-scheduling-php-scripts-running-scripts-in-background/ Share on other sites More sharing options...
monkeypaw201 Posted April 22, 2008 Share Posted April 22, 2008 1. cron jobs 2. run scripts on same page as form then redirect w/ information necessary for the report Link to comment https://forums.phpfreaks.com/topic/102416-2-questions-scheduling-php-scripts-running-scripts-in-background/#findComment-524455 Share on other sites More sharing options...
peterbz Posted April 22, 2008 Author Share Posted April 22, 2008 And you please explain what are cron jobs? Link to comment https://forums.phpfreaks.com/topic/102416-2-questions-scheduling-php-scripts-running-scripts-in-background/#findComment-524507 Share on other sites More sharing options...
jonsjava Posted April 22, 2008 Share Posted April 22, 2008 Cron jobs are jobs that you setup in linux (or with an exe in windows) that runs scripts at set intervals. Link to comment https://forums.phpfreaks.com/topic/102416-2-questions-scheduling-php-scripts-running-scripts-in-background/#findComment-524509 Share on other sites More sharing options...
peterbz Posted April 23, 2008 Author Share Posted April 23, 2008 Is it possible to detect when an update to multiple databases are finished from another script. For example, I have a script that updates 200 databases. This will probably take a while to finish. Then I want another script to execute when the first is completed. How can I do that? Link to comment https://forums.phpfreaks.com/topic/102416-2-questions-scheduling-php-scripts-running-scripts-in-background/#findComment-524547 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.