includes/dbal.php
changeset 468 194a19711346
parent 424 f58e0b6e9c22
child 475 51386f1852b8
equal deleted inserted replaced
467:e4bbd6fb8df3 468:194a19711346
   101   }
   101   }
   102   
   102   
   103   function die_json()
   103   function die_json()
   104   {
   104   {
   105     $e = addslashes(htmlspecialchars(mysql_error()));
   105     $e = addslashes(htmlspecialchars(mysql_error()));
   106     $q = addslashes($this->latest_query);
   106     $q = str_replace("\n", "\\n", addslashes($this->latest_query));
   107     $t = "{'mode':'error','error':'An error occurred during database query.\nQuery was:\n  $q\n\nError returned by MySQL: $e'}";
   107     $t = "{'mode':'error','error':'An error occurred during database query.\\nQuery was:\\n  $q\\n\\nError returned by MySQL: $e'}";
   108     die($t);
   108     die($t);
   109   }
   109   }
   110   
   110   
   111   function get_error($t = '') {
   111   function get_error($t = '') {
   112     header('HTTP/1.1 500 Internal Server Error');
   112     header('HTTP/1.1 500 Internal Server Error');