public function __construct($message, $code, $query, array $params = null)
 {
     $this->code = $code;
     if (isset($params)) {
         for ($i = 0; $i < count($params); ++$i) {
             if (is_null($params[$i])) {
                 $params[$i] = '<i>NULL</i>';
             } else {
                 if (is_string($params[$i])) {
                     $params[$i] = "'" . htmlentities($params[$i]) . "'";
                 }
             }
         }
         $p = '';
         for ($i = 1; $i <= count($params); ++$i) {
             $p .= "<b>{$i}:</b> " . $params[$i - 1] . "<br>";
         }
     } else {
         $p = '';
     }
     parent::__construct("<h3>{$message}</h3><p><b>Error code</b>: {$code}</p><b>Query</b>:\n\n<code>{$query}</code>\n\n<b>Parameters</b>:\n\n{$p}\n");
 }
 public function __construct($filename)
 {
     parent::__construct("File <b>{$filename}</b> can't be written to.\nPlease check the permissions on the file or on the containing folder.");
 }
 public function __construct($filename, $extra = '')
 {
     parent::__construct("<p>File <kbd>{$filename}</kbd> was not found.</p>{$extra}");
 }