Hello Moodle Comunity!
I have got a weird problem with my custom moodle page. I moodle database I created a new table with three fields:
- user_id (as string),
- agreement (boolean),
- agreement_date (for development as string).
Also, I create a custom PHP page, where when, the user enters on the page this will be annotated in DB.
I create the query using moodle docs:
$myData= new stdClass();
$myData->user_id = getCurrentUserFunction();
$myData->agreement = 'true';
When thic code is running I get a information "Error writing to database", but... my data is saved in the DB.
Maybe somebody has some idea?