LMSouq
moodle-core Open

Moodle Error writing to database

MO
MOZ
1 month ago
3 views
Problem Description
I am getting Error writing to database in moodle: Code: if (is_siteadmin()) { class addschedule_form extends moodleform { function definition () { $mform =& $this->_form; $mform->addElement('text', 'id', 'Enter ID:'); $mform->setType('id', PARAM_TEXT); $this->add_action_buttons(true, 'submit'); } } $ti_form = new addschedule_form(); $ti_form->get_data(); if ($ti_form->is_cancelled()) {redirect('index.php');} if ($recs = $ti_form->get_data()) { $deleteit = $DB -> delete_records('DELETE * FROM `mdl_schedules` WHERE id = ' . $recs -> id . ''); redirect('schedule.php'); } } else { } $ti_form->display(); What could be the reason? Any reference or help will be much appreciated. Regards

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base