We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

A suggestion to improve core DB class

Development and Programming

nixMe's avatar
nixMe
6 posts
17 years ago
nixMe's avatar nixMe

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.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.