-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete_project.php
38 lines (21 loc) · 985 Bytes
/
delete_project.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
<?php
$project_ID_toremove = $_POST['projectID'];
$servername = "localhost";
$username = "host";
$dbpassword = "Team017FTW!";
$database = "makeitall";
$conn = new mysqli($servername, $username, $dbpassword, $database);
// SQL query to fetch staff not currently in team from the database
$sql = "DELETE FROM project_staff WHERE project_id = '$project_ID_toremove';";
$result = $conn->query($sql);
// SQL query to fetch staff not currently in team from the database
$sql = "DELETE FROM projects WHERE project_id = '$project_ID_toremove';";
$result = $conn->query($sql);
//SQL query that deletes the user off all tasks they're assigned to
$sql = "DELETE FROM task_staff WHERE project_id = '$project_ID_toremove';";
$result = $conn->query($sql);
//SQL query that deletes the user off all tasks they're assigned to
$sql = "DELETE FROM tasks WHERE project_id = '$project_ID_toremove';";
$result = $conn->query($sql);
$conn->close();
?>