I was wondering if there is a way I can get the latest mysql error from the $db object, or if there is a value somewhere that I can check if there has been a database error.
At the moment I can either check the debug output or simply use the mysql_error() function, but sometimes I can't turn debugging on for various reasons and obviously using mysql_error isn't that great for portability (ie: if we switch to postgres down the track).
There is an array variable in the $db object called 'query_list_errors' but it is always empty even if I introduce deliberate sql syntax errors. Is there some built in function or variable that I can use?
Get Database debugging information
- FantomCircuit
- Forum Members
- Posts: 75
- Joined: Fri Nov 10, 2006 1:34 am
- Location: Gold Coast, Australia
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Get Database debugging information
$db->ErrorMsg(); that's the simple wrapper around the mysql_error() function.
It's in the adodb stuff.
It's in the adodb stuff.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
- FantomCircuit
- Forum Members
- Posts: 75
- Joined: Fri Nov 10, 2006 1:34 am
- Location: Gold Coast, Australia
Re: Get Database debugging information
Awesome, thanks for the fast reply calguy. Works exactly as you said 
