Debug SQL generated by $DB methods


A handy debugging tip, if you need to debug the SQL generated by any of the $DB methods (see DML API), you can use the following around the statement(s) to display the SQL:

$DB->set_debug(true);

//...

$DB->set_debug(false);

Revision #2
Created Tue, Aug 6, 2019 7:45 PM by Moodle Wiki
Updated Tue, Aug 6, 2019 7:46 PM by Moodle Wiki