Posts

Showing posts from October, 2024

Read Table Data in CodeIgniter 3

Image
  <?php defined ( "BASEPATH" ) or exit ( "No direct script access allowed" ); class Contacts extends CI_Controller {     public function __construct ()     {         parent :: __construct ();     }     public function index ()     {         $this -> load -> model ( "ContactsModel" );         $data [ "details" ] = $this -> ContactsModel -> getContacts ();         $this -> load -> view ( "contacts_view" , $data );         $this -> load -> model ( "StudentsModel" );         $data [ "records" ] = $this -> StudentsModel -> getStudentsData ();         $this -> load -> view ( "students_view" , $data );     } } Above File is application/controllers/Contacts.php File Below File is application/models/ContactsModel.php File <?php defined ( "BASEPAT...

Read Two Tables data using INNER JOIN with CodeIgniter 3

Image
  <?php defined ( "BASEPATH" ) or exit ( "No direct script access allowed" ); class Read extends CI_Controller {     public function construct ()     {         parent :: __construct ();     }     public function index ()     {         $this -> load -> model ( "ReadDataModel" , "" , TRUE );         $data [ "data_details" ] =   $this -> ReadDataModel -> readAllData ();         $this -> load -> view ( "showData" , $data );     } } Above File is application/controllers/Read.php File. Below File is application/models/ReadDataModel.php File. <?php defined ( "BASEPATH" ) or exit ( "No direct script access allowed" ); class ReadDataModel extends CI_Model {     public function __construct ()     {         parent :: __construct ();     }     public funct...