Stop PHP execution on client connection closed
| From: | Marco Lanzotti | Date: | Mon, 12 Sep 2011 14:40:46 +0000 |
| Subject: | Stop PHP execution on client connection closed | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-314776@lists.php.net to get a copy of this message | ||
Hi all, I'm new in the list and I already have a question for you.
I'm running an heavy query on my DB in a PHP script called by AJAX.
Because client often abort AJAX connection to ask a new query, I need to
stop query because DB will be too loaded.
When AJAX connection is aborted, PHP script doesn't stop until it send
some output to client, so I need to wait query execution to know client
aborted connection.
How can I abort query (or script) when AJAX connection is aborted?
Thank you,
Marco