Delete records from MySQL database is an easily SQL command. You need to put the key value just as id, name or others into this command. This tutorial use the file select.php from Update Record tutorial and make a new file delete.php.
In this file, you have to put some codes for a new link. This link will send GET method parameter to delete.php.
Browse "select.php" by go to http://localhost/select.php.
Result : (Links below are NOT real on this page)
ID : 1
Name : Jack
Email : [email protected]
Tel : 12345678 Update Delete<- when you mouse over this. It will show "http://localhost/delete.php?id=1"in your browser's status bar.
ID : 2
Name : Joe
Email : [email protected]
Tel : 87654321 Update Delete <- when you mouse over this. It will show "http://localhost/delete.php?id=2" in your browser's status bar.
...
The values are the same as ID parameters. When you click on these links, the page will change to delete.php.
• delete.php
This file will get parameter($id) from select.php and delete the record where id column equal in $id .
Test
Browse select.php on your web browser as http://localhost/select.php and click on "Delete" link. This page will go to delete.php with id record and delete.php will delete this record and re-direct back to select.php immediately.