Get Database debugging information
Posted: Mon Feb 11, 2008 12:04 am
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?
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?