Delete Contact Information
We already did in the tutorial for
Insert Contact Information and
Update Contact Information. So, I decided to create a follow-up tutorial for
Delete Contact Information.
We're gonna use
Delete Statement to delete data from our database table.
This is our data.
Delete - PHP Query Using PDO
<?php
require_once('db.php');
$get_id=$_GET['tbl_member_id'];
// sql to delete a record
$sql = "Delete from tbl_member where tbl_member_id = '$get_id'";
// use exec() because no results are returned
?>
Delete Button
<a href="delete_contact.php<?php echo '?tbl_member_id='.$id; ?>">
<button type="submit" class="btn_confirm" onclick="return confirm(' Delete Contact ( <?php echo $first_name?> ) ? ');">
Delete
Output:
Deleting Data.
After Deleting Data.

Share us your thoughts and comments below. Thank you so much for dropping by and reading this tutorial post. For more updates, don’t hesitate and feel free to visit this website more often and please share this with your friends or email me at
[email protected]. Practice Coding. Thank you very much.