-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfetch.php
More file actions
50 lines (42 loc) · 1.51 KB
/
Copy pathfetch.php
File metadata and controls
50 lines (42 loc) · 1.51 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
<?php
include 'db.php';
if(isset($_POST["id"])){
$output = array();
$procedure = "
CREATE PROCEDURE whereTask(IN user_id int(11))
BEGIN
SELECT * FROM taskmanager WHERE id = user_id;
END;
";
if(mysqli_query($connect,"DROP PROCEDURE IF EXISTS whereTask")){
if(mysqli_query($connect,$procedure)){
$query = "CALL whereTask(".$_POST["id"].")";
$result = mysqli_query($connect,$query);
while($row = mysqli_fetch_array($result)){
$output['project_title'] = $row["project_title"];
$output['task'] = $row['task'];
}
echo json_encode($output);
}
}
}
if(isset($_POST["id"])){
$output = array();
$procedure = "
CREATE PROCEDURE whereTask(IN user_id int(11))
BEGIN
SELECT * FROM taskmanager WHERE id = user_id;
END;
";
if(mysqli_query($connect,"DROP PROCEDURE IF EXISTS whereTask")){
if(mysqli_query($connect,$procedure)){
$query = "CALL whereTask(".$_POST["id"].")";
$result = mysqli_query($connect,$query);
while($row = mysqli_fetch_array($result)){
$output['project_title'] = $row["project_title"];
$output['task'] = $row['task'];
}
echo json_encode($output);
}
}
}