Basic insert, view, edit, delete and update using PHP and Mysql

Must Read : Basic insert, view, edit, delete and update using PHP and Mysql

Hi today i going to post one of old topic in php and mysql, here i’m going to post Insert data through form, and fetch / view the data from database, and also Edit, Delete and Update with detailed explanation. i know mysql is depreciated, even most of the people are using mysql so now i’m going to use mysql and i’ll update with mysqli and pdo later, now i’m going to explain the basics of php mysql functions, how to insert, fetch, delete, update like all operations.

FILES
  • db.php
  • index.php
  • insert.php
  • view.php
  • edit.php

DB.PHP
first we have to connect the db file.

INDEX.PHP

INSERT.PHP
the index.php page form is run in the insert.php.

if the data is successfully registered, the header location will be to index.php

VIEW.PHP

View page contains edit and delete link in the while loop, here we are passing the values though id for edit and delete, like

we have to give this link before the while loop ends,

DELETE.PHP

the delete.php is deleting the data what are the data is there in the ID. if successfully deleted the page will goes to index.php page.

EDIT.PHP

(Visited 84 times, 1 visits today)

Leave a Comment.