random1 Posted May 1, 2008 Share Posted May 1, 2008 I've notice that most PHP apps don't have a default behavior when: The database connection fails The server is unavailable What are the best ways to handle these situations? Should the user be redirected to a nicer version of a cannot connect page? Basically I want to know what is a logical response to these situations? Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted May 2, 2008 Share Posted May 2, 2008 It does have a default behavior. If you're using PDO it'll throw an exception, the other extensions will generate errors. You should hide both of those from the user. Just tell them an unexpected error occurred. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.