Hello,
Just wanted to share an idea/enhancement I’ve already built into the EE core DB class. I added 2 new arguments to the query method. Both are strings set to empty string by default. The first is a line number from which the query was executed and second is the filename the query was executed in. This makes DB error reporting and debugging easier for me because I know exactly where to look amongst the arbitrary amount of files and lines of code I execute queries in.
Basically the code for queries ends up looking like this:
$DB->query("SELECT * from exp_modules",__LINE__,__FILE__);
If for some reason this caused an error the DB class will output the line number and filename from where the above query originated.
There may be an easier way of accomplishing this kind of error reporting but this works great for me.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.