santi20
Platform Niche Strategist
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 2
1000 XP
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
Delete Button
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.
Download
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
- $conn
->
exec
(
$sql
)
;
- header
(
'location:index.php'
)
;
- ?>
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
- </
button
>
- </
a
>
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.
Download
You must upgrade your account or reply in the thread to view the hidden content.