barbapapa Posted June 7, 2008 Share Posted June 7, 2008 Hi, is there a way to set a timeout before executing a mysql query (or something else), e.g <?php function timeoutfunc() { echo 'timeout triggered!'; } ... set_code_execution_timeout('45 seconds', timeoutfunc); mysql_query ('long query'...); ... ?> This would trigger a timeout and call timeoutfunc() if exec time of query is > 45 seconds. Of course the function set_code_execution_timeout() doesn't exist. - is there a way to do the same thing? - maybe using exceptions? Thank you. bbpp Link to comment https://forums.phpfreaks.com/topic/109145-how-to-trigger-and-control-a-timeout/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.