Re: Stop PHP execution on client connection closed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/12/2011 7:40 AM, Marco Lanzotti wrote:
> 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
> 
> 

You cannot stop a DB query.

What this means is PHP will not be able to do anything else until the db has
finished its step and handed data back to the processing script.  At that point,
you can check to see if the connection is still active and take appropriate action.

Jim Lucas

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux