LMSouq
moodle-core Open

insert_record(); Error writing to database

AU
aung aye
1 month ago
3 views
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

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