Hi Guys...
I'm making a form with the ability to delete users. But don't know how to do it...
My form structure..
users.php ---- Lists a user with options like edit user / delete user. (His details are displayed from database on my html page in a table.)
For delete user, I want to (the Delete should only mark as deleted, not physically delete entry ‐ removes auditing ability) from the mysql database.I want to display the confirmination before deleting. Pluse the row which the record is showing on my html page should also be removed...In the database I have a table called users, in the table there is a row/colum called " bIsDeleted ". It's datatype is tinyint and it's defult value is "0". I have build the php syntax for my delete function as follows:
On users.php -- admin clicks on the delete image.
<a href="deleteuser.php?user_Id=<? echo $row["user_Id"] ?>"><img src="images/delete.gif" width="16" height="16" alt="Delete" border="0"/></a>
On deleteuser.php --- my php code...
<?php
include("_include/ssi/dbconfig.php");
$user_Id = $_GET['user_Id'];
$delete = "UPDATE users SET bIsDeleted = 1 WHERE user_Id='$user_Id' ";
mysql_query($delete);
mysql_close();
echo "Entry deleted";
header("Location: users.php");
?>
In simple words, i want;
1. Delete function -- It should display a confirmation message before deleting.
2. I want the displayed entry on html page to be removed from my html table but not from mysql. It should only be flaged in the databse table.
Thanks...