Fetch records between date range using Codeigniter active record

How to insert multiple array data using codeigniter active record

Below is the example to insert multiple array data using query builder class of codeigniter. By using $this->db->insert_batch() method we can achieve this.

defined(‘BASEPATH’) OR exit(‘No direct script access allowed’);
class InsertController extends CI_Controller {
public function __construct()
    public function index() {
        $data[] = array(
$data[] = array(
$this->db->insert_batch( ‘tbl_user’, $data );

Thank you for reading this post. we hope you like this Post, Please feel free to comment below, your suggestion and problems if you face – let us know. We’d love to help!