Hi All,
We have a commercial php/mysql web application and we have recently added mysql transaction support, whilst developing we noticed that when the user aborts (i.e. pressing the stop button in the web browser). the script continues to run untill it times out...which is not the desired outcome.
I have set 'ignore_user_abort(false)' and registered a function with 'register_shutdown_function' to rollback the transaction (and this works it the script call's a php die etc...)
So basically when the user aborts i want the script to actually terminate and hence to run the function that i registered with 'register_shutdown_function'.
A little script i wrote to test this (which i though would terminate when i press the stop button, but continues untill timeout) is below:
<?
ignore_user_abort(false);
db_connect();
transaction_start();
while(1) {
db_update("UPDATE claim
SET created = NOW()
WHERE claimno = 14070");
sleep(2);
}
?>
Thanks in advance for any suggestions/help.
Keith