RE: [PHP] need better solution
| From: | Maxim Maletsky | Date: | Fri, 16 Feb 2001 03:19:25 +0000 |
| Subject: | RE: [PHP] need better solution | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-40077@lists.php.net to get a copy of this message | ||
yeah ... then at this point why not to use PHPLIB that has it built in
already...
phplib.netuse.de
a great thing ...
Cheers,
Maxim Maletsky
-----Original Message-----
From: Chris Lee [mailto:lee@mediawaveonline.com]
Sent: Thursday, February 15, 2001 1:02 AM
To: php-general@lists.php.net
Subject: Re: [PHP] need better solution
works for me, just call it. change it to better match yours if you like.
function check_db($query = 'Unavailble')
{
global $store_db;
if ( mysql_errno() )
{
echo "Error: Problem with DataBase : $store_db<br>\n";
echo "Error: " . mysql_errno() . ':' . mysql_error() .
"<br>\n";
echo "Query: $query<br>\n";
exit();
}
}
I havent played with a more automatic metod, ie. error_reporting();
--
Chris Lee
Mediawaveonline.com
em. lee@mediawaveonline.com
ph. 250.377.1095
ph. 250.376.2690
fx. 250.554.1120
""Christian Dechery"" <lemming@vento.com.br> wrote in message
news:3A892ADF000002BF@webmail.vento.com.br...
I need a better solution for reporting SQL errors.
I'm used to work with ASP, and whenever a query has a syntax error, it stops
the script and reports the error as if it was a compile error. This is very
usefull, but int PHP it doesn't work like that, I know.
I came with a function query_error() that I call after each query, that
prints out the query, the error and the line... so I need to call it like
this.
if(!$rs) query_error($query,__LINE__);
but having to writ this down after EVERY single query, along with the
__LINE__
thing can get very boring, does anyone has a better solution?
. [ Christian Dechery ]
. Webdeveloper @ Tá Na Mesa!
. Listmaster @ Gaita-L
. http://www.tanamesa.com.br
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net