-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfaq_update.php
More file actions
33 lines (26 loc) · 781 Bytes
/
faq_update.php
File metadata and controls
33 lines (26 loc) · 781 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
<?php
include 'db_connect.php';
$id = $_GET['id'];
$postdata = file_get_contents("php://input");
$pertanyaan = "";
$jawaban = "";
if (isset($postdata)) {
$request = json_decode($postdata);
$pertanyaan = $request->pertanyaan;
$jawaban = $request->jawaban;
$q = mysqli_query($connect, "UPDATE faq SET pertanyaan='$pertanyaan', jawaban='$jawaban' WHERE id='$id'");
if($q){
$data =array(
'message' => "Update Data FAQ Succses",
'status' => "200"
);
}
else{
$data =array(
'message' => "Update Data FAQ Failed",
'status' => "404"
);
}
}
echo json_encode($data);
?>