abdfahim Posted January 8, 2008 Share Posted January 8, 2008 When I insert huge amount of data to my mysql table using php, sometime I want to stop inserting in some middle point. But if I even close the window, mysql continue inserting in background. Is there any way that I forcefully stop the execution of mysql_query() command at some mid-point of the execution? Quote Link to comment https://forums.phpfreaks.com/topic/85003-how-to-stop-sql-execution-in-php/ Share on other sites More sharing options...
Ken2k7 Posted January 8, 2008 Share Posted January 8, 2008 Well do you know the point you want to stop it? Like there has to be a situation of course. Just use an IF statement to check for it and then use break; to break out of the loop. That would end the loop and the mysql_query() at that point. Quote Link to comment https://forums.phpfreaks.com/topic/85003-how-to-stop-sql-execution-in-php/#findComment-433491 Share on other sites More sharing options...
abdfahim Posted January 9, 2008 Author Share Posted January 9, 2008 Well, my case is not that easy. Everyday I have to calculate many data and insert it into database. Now I dont know why, but some day it takes like 10 minuites, but some time even after 5/6 hours, the process is still running (I know that because I see mysqld-nt process running and taking cpu/ram in task manager). In that case, I want to stop execution if it takes so long. Quote Link to comment https://forums.phpfreaks.com/topic/85003-how-to-stop-sql-execution-in-php/#findComment-434485 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.