Hi,
In the database the field idnumber in the table course is not a number.
$course = $DB->get_records('course',array('idnumber' => MYCOURSE_2021)); // it's worked
you probably need to assign $idnumber like this : $idnumber = '6417';
And use strval() to be sure it's consider as a string if it's come from somewhere else.
Dominique.
In the database the field idnumber in the table course is not a number.
$course = $DB->get_records('course',array('idnumber' => MYCOURSE_2021)); // it's worked
you probably need to assign $idnumber like this : $idnumber = '6417';
And use strval() to be sure it's consider as a string if it's come from somewhere else.
Dominique.