I'm using Moodle 3.2 version.
I have a custom form in the file, and created a table in database.
After submitting the form, how can i store the form fields in to the database table?
Here is the code i have written.
$userid = $USER->id;
$courseName = $Course->fullname;
$text = $_POST['name'];
$extdbuser1 = (object)array('userId'=>$userid, 'courseName'=>$courseName, 'journalText'=>$text);
$extdbuser1->id = $DB->insert_record('end_journalcontent', $extdbuser1);
userId, courseName, journalText are column names in the table.
end_journalcontent my table name
What is the query to store data into DB table?
Thanks for your help in Advance.