- Do something more intelligent when the report query fails, like, print a

friendly message with the failed query.
This commit is contained in:
dave 2007-12-10 03:05:35 +00:00
parent 4cacf1b945
commit c44803e365

View File

@ -575,10 +575,21 @@ foreach($report_stock as $n=>$v) {
$q = call_user_func_array($func, array($report, $components));
$q = "SELECT $sel $q $filter_query $group_query ORDER BY $order";
// print("$q");
$r = mysql_query($q);
if($r == false) {
echo "The report database query has failed. This is
unfortunate but not your fault. Please send the following to
your fair administrator, or visit <a
href=\"http://www.sfiab.ca\">http://www.sfiab.ca</a> and submit
a bug report so we can get this fixed.<br />";
echo "<pre>";
echo "Query: [$q]<br />";
echo "Error: [".mysql_error()."]<br />";
echo "</pre>";
exit;
}
echo mysql_error();
$ncols = count($report['col']);