-
Notifications
You must be signed in to change notification settings - Fork 0
/
del.php
executable file
·42 lines (32 loc) · 1.08 KB
/
del.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
41
42
<?php
$id = $_GET['id'];
$conn = new mysqli("localhost","needyamin","Yamin143","test1");
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql1 = "DELETE FROM `needyamin_smartlink` WHERE `id` = '$id';";
$sql2 = "DELETE FROM `needyamin_category` WHERE `last_insert_smartlink_id` = '$id';";
$sql3 = "DELETE FROM `needyamin_users` WHERE `last_insert_smartlink_id` = '$id';";
//////////////////////////////////////////
if ($conn->query($sql1) === TRUE) {
echo "Record deleted successfully";
} else {
echo "Error deleting record: " . $conn->error;
}
//////////////////////////////////////////
//////////////////////////////////////////
if ($conn->query($sql2) === TRUE) {
echo "Record deleted successfully";
} else {
echo "Error deleting record: " . $conn->error;
}
//////////////////////////////////////////
//////////////////////////////////////////
if ($conn->query($sql3) === TRUE) {
header('location: index.php?del=deleted');
} else {
echo "Error deleting record: " . $conn->error;
}
//////////////////////////////////////////
;?>