Page 1 of 1

extend mysql error message with php line (v2020)

Posted: Sat Mar 18, 2023 8:21 pm
by gregor4711

HI,

I have made some changes in a custom file wich hold many of sql statements.

When I go to an phpmaker page I got the last msql error.

Since the message is '' it is hard to find.

Sure I have acces to php and mysql errorlog, but there are no more information as shown.

I would like to extend the shown message with the php file and line which cause the mysql error.

This is possible with this:

$db->setTrace (true);
// As a second parameter it is possible to define prefix of the path which should be striped from filename
// $db->setTrace (true, $_SERVER['SERVER_ROOT']);
print_r ($db->trace);

Trace will show the php file and line which cause the mysql error:

Failed to execute SQL. Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 (1064)

Where and what should I extend to enable better debuging?

Thanks for your help.


Re: extend mysql error message with php line (v2020)

Posted: Sat Mar 18, 2023 10:41 pm
by mobhar

You may post your code in that Custom File for more discussion.


Re: extend mysql error message with php line (v2020)

Posted: Mon Mar 20, 2023 2:57 pm
by gregor4711

solve it with advanced settings -> debug