Category: PHP

The Codeigniter allows us to perform the database action like – select, insert, update, and delete with the minimal script.

The $this->db->update() method is used for update existing record. It takes table name and an array or object as the parameter.

In the demonstration, I am listing the user’s list with the edit option. Show the update form on edit option click.

Update records in Database Table with CodeIgniter

DataBase PHP

You can use jQuery AJAX to autocomplete data on the single or multiple elements when the user search or select value from an element.

It is a better way to allow the users to easily search for data in existing records and get required information e.g. get student details by its id, product details, etc.

In the demonstration, I am using jQuery UI to display suggestion list and fetch details using PHP from the MySQL database table when a value from the suggestion list is gets selected.

How to autocomplete data on multiple fields with jQuery and AJAX


CodeIgniter have an inbuilt upload library that allows to upload file.  You can specify various preference like – destination path, valid file types, max file size, etc.

In this tutorial, I create a simple example to demonstrate file uploading in CodeIgniter.

How to upload file in CodeIgniter


If you know how to send jQuery AJAX request in Core PHP then it is simpler for you to do it in CodeIgniter.

In CodeIgniter, you can use the controller and model to handle AJAX call instead of creating the separate file. Make AJAX call either from the view or external script file.

In this tutorial, I am creating a simple example to demonstrate the AJAX calling in CodeIgniter.

How to Send AJAX Request In CodeIgniter


Load more pagination allows the users to load new content on a button click. This appends new content with existing contents.

It is the type of infinite pagination where the user has to click the action button to view new records. This load data until records are available.

In this tutorial, I am implementing this functionality on a page with AngularJS and PHP.

Load more pagination with AngularJS and PHP


The autocomplete functionality shows the suggestion list according to the entered value. The user can select a value from the list.

With jQuery UI you can easily add autocomplete widget on the input element. Navigate to the suggestion list either by mouse or keyboard arrow keys.

It has the various options that allow us to customize the widget.

You can fix the suggestion source value while initializing in this case whenever the user typed any character then it searches the value within the given source value or you can make it dynamic with AJAX.

In the demonstration, I am implementing this on an element which shows the user’s name list according to the entered value with AJAX.

jQuery UI autocomplete with PHP and AJAX


All logical operation and database handling done in the Models like insert, update or fetch records.

Codeigniter has predefined Database methods to perform database request.

In the demonstration, with View show the HTML form and when the user submits the forms then call the Model method to insert record from the controller.

Insert record to Database Table - Codeigniter


Codeigniter is a lightweight PHP-based framework to develop the web application. It is based on MVC (Model View Controller) pattern.

  • The model handles the data processing – Return data, Insert, Update, or delete records from Database Table.
  • The view displays the final output.
  • The controller manages the Model and view. It handles the users’ inputs.

In this tutorial, I cover basis about Codeigniter.

How to install and setup Codeigniter


AJAX is use to communicate with the server to perform the action without the need to refresh the page.

You can either handle AJAX requests on the same page or on the separate page.

In this tutorial, I show how you can send and receive AJAX requests on the same page.

How to handle AJAX request on the same page - PHP


Most of the eCommerce sites e.g. Flipkart, Snapdeal, etc have a price range slider for searching purpose.

The user doesn’t have to enter price range manually.

It will automatically filter the list when the price is been changed by the user.

In this tutorial, I am implementing the similar type of functionality with AngularJS and PHP.

Using jQuery UI to create the slider.

Make Price Range Slider with AngularJS and PHP

AngularJS PHP