hello friends,
I wanted to catch my timeout error..
i have tried with the way given in manual,
but still i am not able to solve the
problem. can anyone pls help me in
solving this problem.
thank u,
karthik
<?
function testtimeout() {
// when connection_status is 2 it means
// shutdown is due to timeout
if(connection_status() == 2) {
echo "Script timeout";
}
}
register_shutdown_function("testtimeout");
set_time_limit(2);
function &get_connection()
{
$conn = mssql_connect "testserver", "sa",
"jacmin");
return $conn;
}
$conn= get_connection();
?>
When i run this program i am getting the following error...
Fatal error: Maximum execution time of 2 seconds exceeded in D:\KHB\tset.php on line 15
Fatal error: Maximum execution time of 2 seconds exceeded in D:\KHB\tset.php on line 4
Where as i am supposed to get the output as
"Script timeout"