title: Is there any way to catch MySQL and database errors in PHP?
body: <p>Sometimes I am getting a database error like</p>
  <blockquote>
  <p>Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'test'@'101.190.193.83' (using password: YES)</p>
  <p>Could not connect: Access denied for user 'test'@'101.190.193.83' (using password: YES)&quot;</p>
  </blockquote>
  <p>But truly there is no change in the password.</p>
  <p>Is there any way to capture this error in a log file and show some nice message on the screen, like <b>&quot;Server error. Please try again some time.&quot;</b></p>