tobben24 Posted January 15, 2011 Share Posted January 15, 2011 I am self-taught in php, and there for lacks some of the fundamental php knowledge.... I an wondering if a php code snippet always will run once to user has started loading it? (If I assume that the server is always working) What happens to the php code when the user hits the 'esc'-button? The reason I ask is due to database consistency. I have a database where multiple tables are dependant of each other. So sometimes I must run multiple sql-statements sequetially, which can lead to inconsitency if the php code does not run compleately. I apologize for bad english:) - Toby Link to comment https://forums.phpfreaks.com/topic/224559-database-consistency/ Share on other sites More sharing options...
litebearer Posted January 16, 2011 Share Posted January 16, 2011 Experiment! Create a php script that takes two minutes to execute - at the end of the script have it write a file on your server - once you 'call' the script via your browser - immediately shut down your browser - wait 3 mins then go check to see if the file was written Link to comment https://forums.phpfreaks.com/topic/224559-database-consistency/#findComment-1160011 Share on other sites More sharing options...
tobben24 Posted January 16, 2011 Author Share Posted January 16, 2011 Well, it seems that php script stops running... Is there a way to ensure the a code snippet will run completly, even if the user quits or hits the 'esc' button? Experiment! Create a php script that takes two minutes to execute - at the end of the script have it write a file on your server - once you 'call' the script via your browser - immediately shut down your browser - wait 3 mins then go check to see if the file was written Link to comment https://forums.phpfreaks.com/topic/224559-database-consistency/#findComment-1160183 Share on other sites More sharing options...
litebearer Posted January 16, 2011 Share Posted January 16, 2011 I believe your answer is here... http://php.net/manual/en/features.connection-handling.php Link to comment https://forums.phpfreaks.com/topic/224559-database-consistency/#findComment-1160188 Share on other sites More sharing options...
tobben24 Posted January 16, 2011 Author Share Posted January 16, 2011 Perfect! Thank you:) I believe your answer is here... http://php.net/manual/en/features.connection-handling.php Link to comment https://forums.phpfreaks.com/topic/224559-database-consistency/#findComment-1160224 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.