CodeIgniter 4 Transaction Example

Introduction Here I am going to show you an example on CodeIgniter 4 transaction using MySQL database server. You know that transaction is an important part of persistence storage system because you may save, update or delete data from persistence storage any time. When you perform execution of multiple statement across different database or tables or any external system then it is recommended to use transaction otherwise your data may be saved in an inconsistent state. For example, in database you may need to update multiple tables or you may…

Continue

React CRUD Example with CodeIgniter 4 and MySQL 8

In this tutorial I am going to show you how to build CRUD application using CodeIgniter 4, MySQL and React JS framework. CRUD is an acronym that stands for Create, Read, Update and Delete operations in a particular application. So you are basically creating a record, reading single or all records, updating the existing record and deleting the existing record. In this React CRUD example with Codeigniter 4 and MySQL, I am using React JS as a front-end technology used for building the UI (User Interface), PHP based CodeIgniter 4…

Continue

Online Visitor Tracking System using CodeIgniter 4, MySQL 8 and AJAX

In this tutorial I am going to show you how you can build an online visitor tracking system using PHP based framework CodeIgniter 4, MySQL 8 and AJAX technique. The similar system for tracking online visitors on web site, I built in past, using CodeIgniter 3 framework. As a web site owner you would like to the progress to the count of your visitors, page views, etc. because, it gives you overall idea on the website’s analytical measurements. It will also give you how you can make improvements to your…

Continue

AJAX Example with CodeIgniter 4 and MySQL – Check Username Availability

Here I am going to explain how to use AJAX with CodeIgniter 4 and MySQL to check the availability of username on key event. So instead of user waiting at the end of the input form and submitting the form, I am going to let user know immediately whether the username he/she is choosing is available or someone else has already taken. This way user does not have to come to the username input field after submitting the form. So if you give instant result to the user for username…

Continue

CodeIgniter 4 Single and Multiple Files Upload Examples

In this tutorial I will show you how to upload single and multiple files using PHP based CodeIgniter framework 4. In many enterprise applications files upload is an important task for various purposes. CodeIgniter makes working with files uploaded through a form much simpler and more secure than using PHP’s $_FILES array directly. This extends the File class and thus gains all of the features of that class. Using PHP’s $_FILES array super global variable has some major shortcomings when working with multiple files uploaded at once, and has potential…

Continue

CodeIgniter 4 Form Validation Example

In this tutorial I am going to show you how to validate form in CodeIgniter 4 framework. CodeIgniter 4 is a PHP based web framework makes your life easier to build the web application quickly right from the scratch. CodeIgniter 4 is still under development and it is supposed to be supported with PHP version 7.2+. I will also tell you how to retain the input values on form so that next time end users do not need to input the same values. Validation is important thing in the world…

Continue

How to create Custom Config File in CodeIgniter 4

In this example I am going to show you how to create and work with custom config file in CodeIgniter 4 framework. A PHP based CodeIgniter 4 framework is the new and future version of the CodeIgniter framework and currently version 4 is still under development. Config file is generally used to declare different configurations for your application. Configurations may be environment variables, database variables, or any other variables or settings you want to do based on a specific environment or profile.

Continue

Sort MySQL Table Data in Ascending or Descending Order in CodeIgniter 4

In this tutorial I am going to show you how to sort MySQL table data in ascending or descending order to display them on HTML table on user interface (UI) using Codeigniter 4. I had also shown similar example using CodeIgniter 3. So when a user wants to see the data on UI either in ascending or descending order then the user needs to click on the table column header to sort the data on HTML table. I have created href link on the HTML table’s column header to make…

Continue

REST API CRUD Example in CodeIgniter 4 Framework

Here I am going to show you how to build REST web services in PHP based Codeigniter 4 framework. CodeIgniter 4 is the upcoming version of the framework and it is still under development, intended for use with PHP 7.2 or higher version. REST is an acronym that stands for Representational State Transfer (RESTful), which is an architectural style for distributed applications. PHP based CodeIgniter framework enables developers to develop the projects much faster, it provides the core part that can easily be extended or replaced completely to make the…

Continue