-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfiledelete.php
More file actions
53 lines (33 loc) · 1 KB
/
Copy pathfiledelete.php
File metadata and controls
53 lines (33 loc) · 1 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
include("connectdb.php");
// error_reporting(0);
// if(isset($_POST['delete'])){
// $id = $_POST['id'];
// $query = "DELETE DELETE FROM files WHERE id = ' $id'";
// $query_run = mysqli_query($conn,$query);
// if($query_run)
// {
// echo '<script>type="text/javascript"> alert("Data deleted")</script>';
// }
// else{
// echo '<script>type="text/javascript"> alert("Data is not deleted")</script>';
// }
// }
// $id = $_POST['id'];
// $sql = "DELETE DELETE FROM files WHERE id= ' $id'";
// $data = mysqli_query($conn,$sql);
// if($data)
// {
// echo "record deleted from database";
// }
// else{
// echo "Failed to delete data from database";
// }
$sql = "DELETE FROM files WHERE id='" . $_GET["id"] . "'";
if (mysqli_query($conn, $sql)) {
echo '<script>type="text/javascript"> alert("Data deleted")</script>';
} else {
echo "Error deleting record: " . mysqli_error($conn);
}
mysqli_close($conn);
?>