× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error reporting for DB queries
We are pushing out an improved DB class in version 4.3 so I can add this.

I'm at work so I don't have time to figure out what's missing, but there's something missing in your execute method.

If you get a chance, take a look at this latest db class

And work in your new execute method and re-paste if you don't mind and we'll get it out there.
I added it to my current DB class and it works on my end. I did modify it previously so I'll sit down soon and look at yours and mine and see what's going on.
Go ahead and give this a try: https://pastebin.com/EADcshuL

I did have to substitute in my modified constructor but changed it back. Here is my constructor with a few different options than standard US, just in case one of those is throwing things off for you: https://pastebin.com/NTDVeSy9
Hi @mudmin would you consider putting in the option for showing database errors during development?

This is what I have been using, i'd be interested to see how you would look at implementing either this or something similar.

Quote:$this->_pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

I have this on my list. The DB class is getting an overhaul in 4.3 so we're definitely working on this. I'll see what I can do.
I'm going to push this issue to the Alpha team. I'm not keeping up with everyone's changes and I'll ask for comments. I'll keep you posted.
Thanks @jmac & @karsen your DB.php made it much easier to figure out why nothing was happening with my app.
Can someone tell me what this error means?

array(3) {
string(5) "42S22"
string(34) "Unknown column '0' in 'field list'"

or how to track it down further than this? As far as I know I'm not trying to refer to anything called 0.

This is of course using the @jmac and @karsen version of the DB class.
Can you paste the query that threw the error?

Forum Jump:

Users browsing this thread: 1 Guest(s)