prepare($query); try { $stmt->execute([ ':status' => $status, ':userId' => $userId ]); echo json_encode(['success' => true]); } catch(PDOException $e) { echo json_encode(['success' => false, 'error' => $e->getMessage()]); } } ?>