]> git.proxmox.com Git - extjs.git/blame - extjs/examples/classic/simple-tasks/php/list/update.php
bump version to 7.0.0-4
[extjs.git] / extjs / examples / classic / simple-tasks / php / list / update.php
CommitLineData
947f0963
TL
1<?php
2
3include '../connection.php';
4
5try {
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
24echo json_encode($jsonResult);
25
6527f429 26?>