How to Import CSV file data to MySQL in CodeIgniter 4

CSV is a widely used format for exchanging data between applications.

The database and data dumps should be in a proper format to import data smoothly and without any issue.

In this tutorial, I show how you can import CSV file data in the MySQL database in the CodeIgniter 4 project.

How to Import CSV file data to MySQL in CodeIgniter 4

Read more

How to Send AJAX request with CSRF token in CodeIgniter 4

Cross-Site Request Forgery (CSRF) requests are a type of malicious exploit whereby unauthorized commands are performed on behalf of an authenticated user.

CodeIgniter 4 provides protection from CSRF attacks. But it is not enabled by default same as CodeIgniter 3.

The token is generated for each user and it is managed by CodeIgniter to verify the user request.

In this tutorial, I show how you can enable CSRF protection and send AJAX request with CSRF token in the CodeIgniter 4 project.

How to Send AJAX request with CSRF token in CodeIgniter 4

Read more

CRUD (Create Read Update Delete) in a CodeIgniter 4

CRUD (Create, Read, Update, and Delete) is a basic requirement when working with database data.

In this tutorial, I show how you can select, insert, update, and delete a record from the MySQL database in the CodeIgniter 4 project.

In the example, I am creating a page to add a new subject and list subjects with the edit and delete buttons.

CRUD (Create Read Update Delete) in a CodeIgniter 4

Read more