LMSouq
moodle-core Open

Struggle to make the right query to the Moodle database table "mdl_logstore_standard_log" in order to export logs as it happens from the GUI

GI
Gizmapps
1 month ago
3 views
Problem Description
My problem is that I am trying to export a csv file from the Moodle DB "mdl_logstore_standard_log" with the exact order as the Logs page under Site Administration > Reports. [The Moodle GUI report fields order][1] One idea to achieve such a thing is through a query like this below: SELECT FROM_UNIXTIME(l.timecreated,'%d %b, %H:%i') AS `Time`, CONCAT(u.firstname, ' ', u.lastname) AS `User full name`, CONCAT(au.firstname, ' ', au.lastname) AS `Affected user`, l.origin AS `Origin`, l.ip AS `IP address` FROM mdl_logstore_standard_log AS l LEFT JOIN mdl_user AS u ON u.id = l.userid LEFT JOIN mdl_user AS au ON au.id = l.relateduserid Unfortunately the query above does not behave as i expect. I need the exact data from the GUI report of moodle. Is there any idea if this query is already implemented in a php file in moodle or somebody tried this before? [1]: https://i.sstatic.net/f3cpx.png

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base