I have searched for an answer, but cannot find one for this particular situation.
I am running a PHP script that runs a single MySQL query via a user search box.
Question:
If the search query takes too long, for example, more than 15 seconds, is there a way to terminate the query and present a message to the user to refine their search or to use different keywords?
I do not want the script to time out with a query and present an error due to maximum time allowed or due to the tmp file running out of space.
What would be the code to insert into the PHP script to terminate the current query process after 15 seconds and display a message?
Thanks in advance.