]>
Commit | Line | Data |
---|---|---|
947f0963 TL |
1 | <?php |
2 | ||
3 | include '../connection.php'; | |
4 | ||
5 | try { | |
6 | $params = json_decode(file_get_contents('php://input')); | |
7 | ||
8 | $statement = $db->prepare("update list set name = '$params->name' where id = $params->id"); | |
9 | ||
10 | if(!$statement->execute()) { | |
11 | throw new Exception(implode(', ', $statement->errorInfo())); | |
12 | } | |
13 | $jsonResult = array( | |
14 | 'success' => true, | |
15 | 'children' => $params | |
16 | ); | |
17 | } catch(Exception $e) { | |
18 | $jsonResult = array( | |
19 | 'success' => false, | |
20 | 'message' => $e->getMessage() | |
21 | ); | |
22 | } | |
23 | ||
24 | echo json_encode($jsonResult); | |
25 | ||
6527f429 | 26 | ?> |