Hello,
in my project I have to solve something:
When database is not active and/or user cannot connect to it I would like to set my app to critical mode when you can handle some logs and manage database settings.
Everything works great (bad username, password, tables and so on) but if I insert bad parameter for dbhost - for example "localhostbad" or really shutdown db. Then PHP just wait for the reaction which never comes and get
Fatal Error: Maximum execution time of 60 seconds exceeded
I don't want such behavior. I want after few seconds to say stop connecting and move on! (DB is not working so never mind and let's handle it 🙂 )
Is here any way how to do it?
Thank you very much!
System on I am testing right now:
IIS7 PHP5.3 MySQL5
(but I also use and want to support in my application different combinations of Apache, Postgre and SQLServer 2008)