PHP MySQL CRUD Application Project

Here I have shared a simple PHP MySQL CRUD application project. This PHP CRUD app is written in all three methods (PDO, MySQLi OOP and Procedural). You can use any one of them as per your choice. All three have the same database structure.

Download the PHP MySQL CRUD app

How to Setup this Project in your System

I hope you have local server (localhost) installed in your system. If not, then install XAMPP to setup your localhsot.

  1. Open your XAMPP Control-panel and start Apache and MySQL server.

Xampp Start apache and MySQL

  1. After that, open your browser and go to your phpMyAdmin , and then create a database called crud by clicking on the New button which is on the left panel of the phpMyAdmin.

  2. After creating the database, you can see the crud database on the left panel of the phpMyAdmin. Click on the database to select the datbase.

  3. After selecting the database, you can see SQL tab at top and after the Structure. Click on the SQL tab. Now you can see a text-area. Copy the following SQL code and paste into the text-area and then click on the Go button.

Executing sql code in phpmyadmin for php crud app

CREATE TABLE `users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `email` varchar(50) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

This SQL code creates a new table called users that has three fields id, name and email. Here the users data will be stored.

  1. After completing the database setup, go to the localhsot htdocs or www directory and clone the chandantudu/php-crud-app repo here or you can extract the downloaded zip file here.

Tip: If you are not able to find the htdocs folder then click on the Explorer which is on your XAMPP control-panel.

Test the PHP CRUD application

To test this PHP crud applicaiton open one of the follwing urls on your browser.

http://localhost/php-crud-app/mysqli/create.php
http://localhost/php-crud-app/mysqli-oop/create.php
http://localhost/php-crud-app/pdo/create.php

PHP MySQL CRUD app Testing