Tag: Codeigniter

AngularJS How To PHP

A database is one of common requirement while building the dynamic application.

It uses to store related data in an organized manner.

You can use more than one database in your application.

If you are using CodeIgniter Framework then you need to define the database connection details separately for multiple databases and load it explicitly for performing operations on the database.

Connect with Multiple Databases in CodeIgniter

DataBase PHP

HTML form is one of the common elements within the webpage which allows the user to input data and submit it for processing.

The data is also passed by URL which is good for limited and less sensitive information.

In this tutorial, I show how you can pass data between view and controller.

Pass Data Between a View and a Controller in CodeIgniter


Sometimes it is required to create separate files which were common on all other pages like header and footer section of the webpage.

This makes easier to maintain the pages.

include statement is used to embed files in PHP.

In CodeIgniter, multiple views embedded in the single view either by controller or view.

Load multiple views in one View - CodeIgniter


A view is an HTML or PHP file in the CodeIgniter which is used to display output on the browser.

From where the user can interact with the website and perform actions.

Views are loaded by the controller and one view can load other views on the page.

In this tutorial, I create a simple demonstration where I create a view and load it from the controller.

How to create and load view in CodeIgniter

How To PHP

CSV files are easier to maintain and can be used for export and import data in the web application.

For data import first, need to allow the users to browse and upload the file. In CodeIgniter, their is upload library available which makes easier to handle file uploads.

In this tutorial, I import data of CSV file in MySQL database table with CodeIgniter.

How to Import Data in MySQL with CodeIgniter

DataBase PHP

CSV (Comma Separated Values ) is the most popular file format for data import and export within the project.

In PHP for creating CSV file, you can either use fputcsv() method or directly write the comma-separated content on the file.

In this tutorial, I will show you how you can export MySQL data in CSV file format in your CodeIgniter project.

Export MySQL data to CSV file in CodeIgniter


Dynamically dependent dropdown commonly seen in the country, state, and city selection on the webpage. The data on the child element changes according to the value of the parent element.

The process follows the same way if there are more than 2 dropdown elements.

To do this you can either use only PHP or jQuery AJAX.

In this tutorial, I am using jQuery AJAX to make dynamic dependent dropdown.

Dynamic dependent dropdown in CodeIgniter with AJAX


A route is a way to remapping, makes more meaningful and SEO friendly URLs. The visitor views the newly generated page URL and the route calls the defined action URL which will be hidden from the visitors.

In CodeIgniter, a URL consists of controller-name/method-name but you can manipulate it by declaring routing.

All routed actions will be written on the specific file.

How to route a URL in CodeIgniter

How To PHP

Pagination on the page improves the user experience when there is a large number of records are available.

CodeIgniter has provided a library for effectively handle the pagination functionality.

In this tutorial, I am using the pagination library to create the paginated list of fetched result from MySQL database.

Make pagination with CodeIgniter Framework