EVOLUTION-NINJA
Edit File: coursemodel1.php
<?php namespace App\Models\Admin; use CodeIgniter\Model; class coursemodel1 extends Model { protected $table = 'courses'; protected $allowedFields = [ 'domain_id', 'sub_domain_id', 'course_title', 'course_image', 'course_demo_video', 'language', 'course_price', 'duration', 'course_type', 'description', 'curriculam', 'instructor', 'partner_id', 'funder_id', 'cer_partner_id', 'delete_status', 'created_by', 'user_type_id', 'created_at', ]; public function get_where_result($course_table, $where_course) { $builder = $this->db->table($course_table); $builder->select('*'); $builder->where($where_course); $query = $builder->get(); return $query->getResult(); } public function insertdata($course_table, $course_data) { $this->table = $course_table; // Set the table name $this->insert($course_data); // Insert the data into the specified table return $this->getInsertID(); } public function insert_data($timing_table, $course_timings) { $this->table = $timing_table; // Set the table name $this->insert($course_timings); // Insert the data into the specified table return $this->getInsertID(); } }