-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-label.php
36 lines (30 loc) · 950 Bytes
/
update-label.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
<?php
//print_r($_POST);
include "conn.php";
$id = intval($_POST["id"]);
$video_id = $mysqli->escape_string($_POST["video_id"]);
$user_id = $mysqli->escape_string($_POST["user_id"]);
$tm = $mysqli->escape_string($_POST["tm"]);
$type = $mysqli->escape_string($_POST["type"]);
$tool = $mysqli->escape_string($_POST["tool"]);
$comment = $mysqli->escape_string($_POST["comment"]);
$thumbnail = $mysqli->escape_string($_POST["filepath"]);
$url = "label.php?vid=$video_id&tm=$tm";
$success = true;
if (!$mysqli->query("UPDATE labels SET video_id='$video_id', user_id='$user_id', tm='$tm', type='$type', tool='$tool'," .
"comment='$comment', thumbnail='$thumbnail' WHERE id=$id"))
$success = false;
if ($mysqli->affected_rows != 1)
$success = false;
$json = array(
"id"=>$id,
"thumbnail"=>$thumbnail,
"tm"=>$tm,
"type"=>$type,
"tool"=>$tool,
"comment"=>$comment,
"url"=>$url,
"success"=>$success
);
echo json_encode($json);
?>