require 'domaindependant.php'; function mysql_query_ex($sql, $errorexits = true, $showerror = false, $showashtmlcomment = false, $errorformat = NULL){ $rs = @mysql_query($sql); if (!$rs){ if ($errorexits){ if ($showerror){ if (is_null($errorformat)) echo 'Fatal SQL error. '.$sql.' MySQL gav denne besked: '.mysql_errno().': '.mysql_error().''; else printf($errorformat, $sql, mysql_errno(), mysql_error()); exit; } else { sqlerror($sql, mysql_errno(), mysql_error()); } exit; } else { if ($showerror){ if (is_null($errorformat)) echo ''.$sql.' '.mysql_errno().': '.mysql_error().''; else printf($errorformat, $sql, mysql_errno(), mysql_error()); } else if ($showashtmlcomment){ if (is_null($errorformat)) echo ''; else echo ''; } return false; } } return $rs; }