This topic is locked

Bug: in 4.2(358) erro rhandler not reporting actual sql

3/19/2008 6:02:40 AM
PHPRunner General questions
S
steveh author

The error handler reports the sql using the global $strSQL, however, this does not really represent the sql being run (e.g. for lookups etc).
For instance, we've just had an error in dbconnection and strSQL did not reflect the contents of qstring.

Alexey admin 3/19/2008

Steve,
if you need to see the actual SQL string to troubleshoot your pages add this line:

echo $qstring;

to the db_query anddb_exec functions in include\dbconnection.phpfile.

S
steveh author 6/27/2008

I think the correct fix for this is to edit the source\include\db_connect* files and in db_query and db_exec, add global $strSQL and set this to qstring, then the error handler reports the actual sql, not some sql that was set ages ago?
Without checking all the code, is there a downsize to this?

S
steveh author 6/27/2008

In fact, the correct edit is just before the trigger error in db_query, to add the global and the assign.

At this point the code has died so whatever strsql may be set to is irrelevant.
I'm changing this in all the source db_connection files.