Simple Crud in PHP and MySQL( Add, Edit, Delete, View in PHP and MySQL)


We are going to learn how to add, edit, delete and view using the language PHP or in simple word we are going to learn CRUD in PHP. We will start first by preparing the tools that we need in building up this project. Anyway, our goal is to create a Simple Student Information System.

Software Requirements:

  • Notepad++/Dreamweaver for our IDE
  • XAMPP/WAMP for our Sever
  • Mozilla Firefox for our Output Platform
  • Bootstrap for our CSS Library

Files to be created:

• Header.php – This will be call in every template of the project to make it uniform and easy to update.
• Menu.php – This will be call in every template of the project as a navigation.
• Index.php –The home of the project.
• Connection.php – Where the connection to server and selecting of database happens. This will also call in every manipulation (add, edit, delete, and view in PHP) of our database.
• Create.php – the template for the create record.
• Read.php – the template for the read/view record.
• Update.php – the template for the update record.
• Delete.php – the template for the delete record.
• bootstrap.min.css – the CSS library. This will help us to design the project in an easy and fast way.
• deleteById.php – the code of deletion of record by ID took place.
• UpdateById.php – the code of update of record by ID took place.

To create the design of the project the templating done first.  In Header.php where the calling of CSS and putting of title:

After we finish the templating it is necessary that we must create the possible form in our CRUD in PHP.


Reading of record

Updating of record

Deleting of record

Thank you for reading this tutorial. To download the sample project just click the link below:

Download “Simple Crud in PHP and MySQL Sample Code” – Downloaded 386 times – 29 KB

Happy Coding. 🙂

  • Hope this help you a lot. Cheers.

  • Fred Boulton

    Hi! Please rewrite for MYSQLi. I might find your scripts useful if I knew how to rewrite them. Maraming salamat, kuya.

    • Thank you for passing by in this article. I will create a version of mysqli as response to your request. Just wait for it. 🙂