this is the best I got so far, for treating any sql syntax errors as normal 
ERROrs and halting the parsing to report it.

like:

<?php
        define(LN,__LINE__);
        $cn=mysql_connect("databasewhatever");
        $query="bogus meant to trigger error query";
        $rs=mysql_query($query) or qerr(LN,$query);

        function qerr($errline,$query="unspecified")
        {
                $msg="<font face=verdana size=2 color=ff0000><b>SQL Syntax Error:</b> 
'$query'</font><br>\n";
                $msg.="<font face=verdana size=2 color=ff0000>[".mysql_errno()."]" 
".mysql_error()."at $errline</font>";
                die($msg);
        }

?>

anyone has a 'less-code' idea?
I wanted a smaller code on the calls to qerr(), I'd really like to call a 1 
parameter (just the query) function and print the error_msg and the line of 
code (the trickiest)...
is there anyway I can define something as a mask for a function or 
something? I don't know... just having crazy ideas...
this is pretty good as it is.. I just wanted even better...
____________________________
. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to