I want to redirect to a friendly error page if an odbc query hangs. The problem is, as stated in the PHP manual . . .
"Note: The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), stream operations, database queries, etc. is not included when determining the maximum time that the script has been running."
. . . the time that passes while a database query is running is not included so the max_execution_time directive doesn't come into play. Also, the trigger_error function doesn't get called (see code below). I have tried checking connection_status() with no success (unless I am mistaken, it applies only to remote client disconnect or the script's max_execution_time referred to above).
<code>
$query = odbc_exec($connectionstring, $sqlstatement);
if (!$query) {
trigger_error("Error - query could not be executed.", FATAL);
}
</code>
What is the appropriate way to handle possible time-out errors resulting from odbc queries?