Is there a way to turn the database error messages on? I have tried to search it here, but could not find an answer.
Display database error message
Display database error message
When i create a module, i sometimes write incorrect sql queries. After all, i'm only human
. But the annoying part is that i won't get a sql error message when that happened. I have to check if the $dbresult variable (result of the Execute function) is false. This is very annoying and time consuming in the debug process.
Is there a way to turn the database error messages on? I have tried to search it here, but could not find an answer.
Is there a way to turn the database error messages on? I have tried to search it here, but could not find an answer.
Re: Display database error message
Have you tried activating debug mode in config.php? I know it shows the query, but am not sure if it shows the error.
-
calguy1000
- Support Guru

- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Display database error message
Code: Select all
if( !$dbresult ) {
debug_display($db->sql);
debug_display($db->ErrorMsg());
}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.
Re: Display database error message
@Wishbone I have tried debug mode; it still throws an error when dbresult = false.
@calguy1000 True, that will work. But since i query alot, i would have to put this code every where. I want to to give me an error message when an error occured, not when i check for errors.
@calguy1000 True, that will work. But since i query alot, i would have to put this code every where. I want to to give me an error message when an error occured, not when i check for errors.

