<?php
include '../connection.php';

$user_id = $_POST['user_id'];
$title = $_POST['title'];
$message = $_POST['message'];

$sql = "INSERT INTO tbl_notifications (user_id, title, message) VALUES (?, ?, ?)";
$stmt = $conn->prepare($sql);
$stmt->bind_param("iss", $user_id, $title, $message);

if($stmt->execute()) {
    echo json_encode(["success" => true]);
} else {
    echo json_encode(["success" => false]);
}
