Dear All,
I am building a block which needs to execute this SQL statement:
$sql = 'SELECT c.fullname AS CourseName, from_unixtime(l.time) AS DateandTime, u.username AS Username, l.ip AS IPAddress, u.firstname AS FirstName, u.lastname AS LastName, u.email AS Email, l.module As Activity, l.action As Action, l.url As URL, l.info AS Information, r.roleid AS RoleID, l.userid AS UserID, c.id as CourseID FROM {log} l, {user} u, {role_assignments} r, {course} c WHERE r.userid = l.userid AND c.id = ' . $courseid; if($Flag == 0) { $sql = $sql . " ORDER BY DateandTime Desc"; } elseif($Flag == 1) { $sql = $sql . " ORDER BY Username Asc"; } |
Where "$courseid" is the selected course ID. when executed, Moodle is returning this ERROR message:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 2048 bytes) in D:\Moodle\lib\weblib.php on line 1277 |
I did use this php command:
ini_set('memory_limit', '-1'); |
But I know that this is not a solution.
Could anyone help me in this and I will be appreciated?
Thanks in advance.
Best regards,
Ahmed