All pastes #406666 Raw Edit

Mortal

public php v1 · immutable
·published 2007-03-22 16:23 UTC
rendered paste body
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. <span style="font-family: monospace">'.$sql.'</span> MySQL gav denne besked: <span style="font-weight: bold">'.mysql_errno().': '.mysql_error().'</span>';        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 '<span style="font-size: 10pt; font-family: Arial"><span style="font-family: monospace">'.$sql.'</span> '.mysql_errno().': '.mysql_error().'</span>';        else          printf($errorformat, $sql, mysql_errno(), mysql_error());      } else if ($showashtmlcomment){        if (is_null($errorformat))          echo '<!-- MySQL fejl kode '.mysql_errno().'. "'.mysql_error().'" SQL brugt: '.$sql.' -->';        else          echo '<!-- '.sprintf($errorformat, $sql, mysql_errno(), mysql_error()).' -->';      }      return false;    }  }  return $rs;}