extend mysql error message with php line (v2020)

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
gregor4711
User
Posts: 66

extend mysql error message with php line (v2020)

Post 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.


mobhar
User
Posts: 11660

Post by mobhar »

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


gregor4711
User
Posts: 66

Post by gregor4711 »

solve it with advanced settings -> debug


Post Reply