-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdoDeleteSource.php
More file actions
69 lines (51 loc) · 1.48 KB
/
doDeleteSource.php
File metadata and controls
69 lines (51 loc) · 1.48 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<html>
<head>
<title>Pipoca</title>
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<body>
<div id="#tudo">
<object data="css/logo.svg" type="image/svg+xml" height=200 width=900></object>
<div id="menu">
<?php include("menu.html"); ?>
</div>
<div id="centro">
<?php
include("connection.php");
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
die("Connection failed: " . mysql_error());
}
//deleting all sources
$sql = "DELETE FROM sources WHERE id='" . $_GET["id"] . "'";
if (mysqli_query($conn, $sql)) {
echo "<h4>Sources removed.</h4>";
$last_id = mysqli_insert_id($conn);
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
//deleting all the codings
$sql = "DELETE FROM sourceCoding WHERE source_id='" . $_GET["id"] . "'";
if (mysqli_query($conn, $sql)) {
echo "<h4>Codings removed.</h4>";
$last_id = mysqli_insert_id($conn);
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
//deleting all the atributes
$sql = "DELETE FROM sourceAttributes WHERE source_id='" . $_GET["id"] . "'";
if (mysqli_query($conn, $sql)) {
echo "<h4>Attributes removed.</h4>";
$last_id = mysqli_insert_id($conn);
} else {
echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
mysqli_close($conn);
?>
Actions: <a href='viewImages.php'>View latest sources</a> | <a href='newImage.php'>Upload a new source</a>
</div>
</div>
</body>
</html>