0

I am working on a report section where user can access their set of data by year and dates

so there will be more then 5 to 6 queries in the api to retrieve the analytical data from the database. but the issue i am facing is it is getting timeout and returning a Error page of timeout in response instead i want to show custom error message to reduce the time interval of the dates Like "Please reduce the interval between dates to retrieve the data"

So how i can achieve this.Try catch i have used but didnt worked for me

try
{
  $data1 =Database->Query1();
  $data2 =Database->Query2();
  $data3 =Database->Query3();
  $data4 =Database->Query4();
  $data5 =Database->Query5();

}catch(/Exception $exception){
   #Show_custom_error
}

is there any other way by i can achieve this ?

Kashyap Patel
  • 1,139
  • 1
  • 13
  • 29

1 Answers1

0

You can set_time_limit in your script file or set it for the entire php installation in your php.ini file. Have a look at the link.

Also checkout this SO question/answers How to catch the fatal error: Maximum execution time of 30 seconds exceeded in PHP

nazim
  • 1,439
  • 2
  • 16
  • 26