I had tried to specified the seconds in set_time_limit(3);
times set_time_limit(3);
function runQuery($sql) {
global $coni;
try {
$execution_time=0;
$time_start = microtime ( true );
$result=db2_exec ( $coni, $sql );
$time_end = microtime ( true );
$execution_time = ($time_end - $time_start) / 60;
return $result;
} catch ( Exception $e ) {
echo "exec error: " . db2_stmt_error ( $sql ) . "<br />";
echo "exec errormsg: " . db2_stmt_errormsg ( $sql ) . "<br />";
}
}
but i did not work My problem is that is it possible to set the SQL execution time in php? e.g i expect my query could return result within 3 seconds, if i could not get result within 3 seconds, then i would like to cancel the query.