Articles → PHP CODEIGNITER → Active Records in codeigniter

Active Records in codeigniter






Purpose





Example




<?php
class mymodel extends CI_Model
{
    public function GetUsers()
    {
        $this
            ->load
            ->database();

        $q = $this
            ->db
            ->get_where("Class", array(
            'classCode' => 'LKG'
        ));
        $result = $q->result();

        return $result;
    }
}






Picture showing the output of active records in codeigniter

Click to Enlarge


Advantages of active record











Posted By  -  Karan Gupta
 
Posted On  -  Friday, July 17, 2020

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250