extend mysql error message with php line (v2020)
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.