Posts

Showing posts with the label CodeIgniter

CRUD operation in CodeIgniter | PHP Gurukul

Image
 In previous tutorial we learned  how to insert data into data in CodeIgniter.  In this tutorial we will learn how to fetch data from database in CodeIgniter. 1. Create a model(Read_data_Model.php) inside application/mode   1 2 3 4 5 6 7 8 < ? php Class Read_data_Model extends CI_Model { public function readdata ( ) { $ query = $ this -> db -> select ( 'fullName,mobileNumber,emailId,gender,address,termsCondition,postingDate' )                -> get ( 'tblusers' ) ;          return $ query -> result ( ) ; } } 2. Create a controller(Read_data.php) inside application/controller   1 2 3 4 5 6 7 8 9 10 11 < ? php Class Read_data extends CI_Controller { public function index ( ) { //load model $ this -> load -> model ( 'Read_data_Model' ) ; //load model function $ results = $ this -> Read_data_Model -> readdata ( ) ; ...

CodeIgniter Interview Questions and Answers | PHP Gurukul

Image
  1. What is CodeIgniter ? Answers :  C odeIgniter is open source & powerful framework used for developing web applications on PHP. It is based on MVC(Model, View, Controller) pattern. 2.  What are the features of CodeIgniter ? Answer :   1. It is an open source framework and free to use. 2. It is extremely light weighted. 3. It is based on MVC(Model, View, Controller) pattern. 4.It has full featured database classes and support for several platforms. 5.Excellent documentation. 3. How you can add or load a model in CodeIgniter ? Answer :   1 $ this -> load -> model ( 'Model_Name' ) ; 4.How you can connect models to  database manually ? Answer :   To connect database manually use following syntax :   1 $ this > load -> database ( ) ;   5.Explain views in CodeIgniter ? Answer :  View folder contains all the markup files like header,footer, sidebar etc. They can be reused by embedding them anywhere in the controll...