Problem Description
I created new table in moodle by phpmyadmin.
Now I want to insert data into new table "dev".
I got ***Error writing to database***.
my code is...
if($_POST['send']){
$id =$_POST['id'];
$name =$_POST['name'];
global $DB;
$data = new stdClass();
$data->dev_id = $id;
$data->dev_name = $name;
$DB->insert_record('dev', $data);
AI-Generated Solution
Powered by LMSouq AI · GPT-4.1-mini
Analyzing problem and generating solution…
Was this solution helpful?