EVOLUTION-NINJA
Edit File: addnewcoursemodel.php
<?php namespace App\Models\Admin; use CodeIgniter\Model; class addnewcoursemodel extends Model { protected $table = 'syllabus'; protected $allowedFields = [ 'sub_domain_id', 'delete_status', 'created_by', 'user_type_id', 'created_at', // Add other fields used in the method ]; public function getWhereRow($syllabus_table, $where_id) { $this->table = $syllabus_table; return $this->select('*') ->from($this->syllabus_table) ->where($where_id) ->get() ->getRow(); } public function insertData($syllabus_table, $syllabus_data) { $builder = $this->db->table($syllabus_table); // Insert the data $builder->insert($syllabus_data); // Return the insert ID return $this->db->insertID(); } public function insert_data($chapter_table, $chapter_data) { $builder = $this->db->table($chapter_table); // Insert the data $builder->insert($chapter_data); // Return the insert ID return $this->db->insertID(); } public function insert_course($topic_table, $topic_data) { $builder = $this->db->table($topic_table); // Insert the data $builder->insert($topic_data); // Return the insert ID return $this->db->insertID(); } }