| Current Path : /home/ataenra/www/ATA/INTRANET/Outils/planing/ |
| Current File : /home/ataenra/www/ATA/INTRANET/Outils/planing/backend_update.php |
<?php
require_once '_db.php';
$json = file_get_contents('php://input');
$params = json_decode($json);
$insert = "UPDATE events SET name = :text, color = :color WHERE id = :id";
$stmt = $db->prepare($insert);
$stmt->bindParam(':text', $params->text);
$stmt->bindParam(':color', $params->color);
$stmt->bindParam(':id', $params->id);
$stmt->execute();
class Result {}
$response = new Result();
$response->result = 'OK';
$response->message = 'Update successful';
header('Content-Type: application/json');
echo json_encode($response);