Welcome to my blog

Hide Scrollbar with CSS

Create, read, update or delete (CRUD) MySQL database records – these are some of the basic things a PHP web programmer must be able to code effortlessly. But if you are a beginner or just want to have a little reference on how these things can be coded, this tutorial post is for you!

This post contains three ways to do this simple PHP CRUD grid. The most updated way is using the PDO extension. MySQLi extension can also be used. And the oldest way is using the MySQL extension.

MySQL extension is not recommended, it has been deprecated since PHP 5.5, so for newer versions of PHP, we have to use either MySQLi (i means improved) or PDO extension. But if you’re debugging with an old software, you can still use this reference I provided below

We will cover the following topics or contents:
1.0 Program Output
1.1 Demo Video

2.0 File Structure

3.0 PDO: Step by Step Programming
Step 1: Create the Database Table
Step 2: Dump Sample Data On The Table
Step 3: Create Database Connection PHP File
Step 4: Create Basic HTML Code Structure For add.php
Step 5: HTML Form To Input New Record Data
Step 6: Code To Save Submitted Data and Create A New Record
Step 7: Create Basic HTML Code Structure For index.php
Step 8: Read The Records From The Database
Step 9: Create Basic HTML Code Structure For edit.php
Step 10: Read A Record Based On Given ID Parameter
Step 11: Create The HTML Form To Update A Record
Step 12: Connect To The Database And Update The Record
Step 13: Tell The User If Record Was Deleted
Step 14: JavaScript To Verify Record Deletion
Step 15: Delete Record From The Database

4.0 PHP and MySQL CRUD – MySQLi Extension
4.1 MySQLi: Connect to Database
4.2 MySQLi: Create New Record
4.3 MySQLi: Read Records
4.4 MySQLi: Update a Record
4.5 MySQLi: Delete a Record

6.0 Source Code Downloads

7.0 Links and Literature
7.1 Online Resources