I need to cancel the connection to a SQL in certain time.
I am storing user data in SQL, but sometimes the connection takes longer than normal, and I want to cancel that.
I need to cancel the connection to a SQL in certain time.
I am storing user data in SQL, but sometimes the connection takes longer than normal, and I want to cancel that.
Although I am not clear about the context of what you are looking for, this function has an argument
$sec
that defines how many seconds it can wait to receive a response before closing the connection.This problem had already been raised on StackOverflow English.
Source: https://stackoverflow.com/questions/415905/how-to-set-a-maximum-execution-time-for-a-mysql-query
And you have additional information here: http://php.net/manual/es/mysqli.poll.php
I hope you find it useful.