I dunno what the big deal is with typing a few more letters, but...
define('E', E_USER_ERROR);
mysql_query($q) or trigger_error(mysql_error()." in ".$q,E);
--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Christian Dechery <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Wednesday, February 28, 2001 10:15 AM
Subject: [PHP] user_error() default error type
> Can't I change the default value for error type in user_error or
trigger_error?
>
> I wanted to echo an error everytime a query failed because of syntax
errors
> so I'd to something like:
>
> $q="select * from bogustable";
> mysql_query($q) or trigger_error(mysql_error()." in ".$q,E_USER_ERROR);
> -----------------> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> kinda BIG don't u think?
>
>
> this would do exactly what I need when an query fails cuz of syntax error:
> - echoes the error, the query and the line of code
> - stop the execution of the script
>
> I NEED all of those, and that E_USER_ERROR in every call is making that
> function call get huge. Isn't there a way I can't default it to that
> instead of E_USER_NOTICE (which doesn't really help)...
> ____________________________
> . 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]
>
--
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]