title: php custom exceptions
body: <p>I was wondering how would one go about writing custom exception handlers.</p>
  
  <p>so that I can do something like</p>
  
  <p><code>throw new dbException($sql, $message);</code></p>
  
  <p>and have it output</p>
  
  <blockquote>
    <p>There was an error in your query
    Message: {$message here}<br>
    Query:   {$sql here}<br>
    Line:    {line exception was thrown on}<br>
    File:    {file exception was thrown from}  </p>
  </blockquote>
  
  <p>but I also want to to catch eg syntax errors and parse errors (if possible)</p>