I am unfamiliar with Moodles methods of updating a database with code.
I have this statement:
$expiredCourseArchiveIntegritaxSql = "UPDATE mdl_course SET category = 29
WHERE expireDate < '" . $date . "'
AND category = 28";
$expiredCourseIntegritaxArchive = $DB->get_records_sql($expiredCourseArchiveIntegritaxSql);
This format works when getting records from a DB but not updating. I cannot find an example of how to updated the db using Moodles $DB functions.
I assume the iussue is that I am using:
$DB->get_records_sql($expiredCourseArchiveIntegritaxSql);
When the syntax should be somthing more like:
$DB->update_records_sql($expiredCourseArchiveIntegritaxSql);