-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget.php
More file actions
34 lines (28 loc) · 850 Bytes
/
Copy pathget.php
File metadata and controls
34 lines (28 loc) · 850 Bytes
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
<?php
require "./config/database.php";
$database = new Database("localhost", "face_scan", "root", "", 3306);
$conn = $database->connection();
$arr = array();
$arr["status"] = "fail";
$arr["response"] = [];
$tmp = [];
try {
$query = "SELECT * FROM face_detail";
$stmt = $conn->prepare($query);
$stmt->execute();
if ($stmt) {
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
$tmp['face_id'] = $row['face_id'];
$tmp['id'] = $row['id'];
$tmp['landmarks'] = json_decode($row['landmarks']);
$tmp['timestamp'] = $row['timestamp'];
$tmp['ref_person'] = $row['ref_person'];
array_push($arr["response"], $tmp);
}
$arr["status"] = "success";
echo json_encode($arr);
}
} catch (PDOException $e) {
echo json_encode($e);
}
exit();