<?php
session_start();
include '../database/db.php';

$id = $_POST['calendar_id'];
$name = trim($_POST['name']);
$user = $_SESSION['user_id'];

$stmt = $pdo->prepare("UPDATE calendars SET name=? WHERE id=? AND user_id=?");
$stmt->execute([$name, $id, $user]);

echo "OK";
