On Friday 16 April 2010 11:39, Antonio PHP wrote: > This maybe a newbie question. > > Consider the following concept, > > ~/index.php > > #1. Fetch data from an external webpage using PHP Curl; > #2. Preg_match/Prepare Data to INSERT from local MySQL; - this may take a > few secs > #3. While Loop { INSERT data (from #2) into local MySQL } - this may take > only mili secs. > > Suppose this code is run by a random user (say, my website visitor), and > he/she closes the browser while the code was running. The real problem is > when the browser is closed while #3 is executing. Because only portion of > data is inserted, ~/index.php, and it doesn't know if it needs to visit the > site again (i.e. repeat from #1 -> over visiting the same webpage / > possibility of inaccurate data in local MySQL).
The server does not know if the browser is closed or not (or if the network connection is losted). It will continue to execute the code until finnished. -- Jørn Dahl-Stamnes homepage: http://www.dahl-stamnes.net/dahls/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org