My site uses onload AJAX. Therefore, when a user entering AJAX calls on page 6 is executed in parallel. In the middle of the process, if the user closes the browser or moves to another page, I want to kill requests.
Steps to achieve this:
1. Locate the following MySQL query execution identifier (connection identifier) ββand save it in the session.
http://dev.mysql.com/doc/refman/5.1/en/show-processlist.html
We need to identify this identifier before executing a READ (select) request. Because PHP will run line by line.
Problem
How do we identify the next connection identifier?
OR
How do we reserve the connection identifier and execute the query on specified identifier?
2 . Run the query in the database.
3. If the user is interrupted, then destroy the execution of the MySQL query. We can detect user aborted status in PHP using the connection_aborted () / ignore_user_abort () function.
Use this following command to complete this request:
KILL ID
performance php mysql mysqli
Sundar
source share