-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremoveOfficer.php
40 lines (30 loc) · 911 Bytes
/
removeOfficer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
$servername = "localhost";
$username = "root";
$password = "";
$db="management_of_prison";
// Create connection
$conn = new mysqli($servername, $username, $password,$db);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$id = $_POST["id"];
//$query = "DELETE FROM officer WHERE officer_id=".$id;
$query = "UPDATE officer SET status = 'inactive' WHERE officer_id=".$id;
//echo $id;
//exit;
if($conn->query($query) == false){
echo 0;
exit;
}
//mysqli_query($conn,$query);
echo 1;
exit;
/*$query = "UPDATE officer SET status = 'inactive' WHERE '$id' "
if($conn->query($query) == false){
die("officer not found !!");
}else{
header("Location: login.html");
}*/
?>