Hey,
I've recently started using PEAR, and am quite impressed by it. However, I have one question about how to use error handling (I mostly understand it.)
When PEAR raises an error with my database, and I print out the error with $errorObj->getMessage(), I get something like "db constraint." Now, when I print it out with $errorObj->getDebugInfo(), I get the entire query, plus something like:
[nativecode=1048 ** Column 'foo' cannot be null]
Now, my question is this: how can I get just this above string, without the MySQL query (the string above typically comes with the query that was just run that failed. I found errorNative(), which will get me the code 1048 code, but I'd really like to just get "Column 'foo' cannot be null". I believe mysql_error() does this in traditional PHP, but I'd like a database-agnostic way of doing it.
Any thoughts? Is there a function I haven't found or didn't try?