<?php

function notify($conn,$user_id,$title,$message,$type,$related_id=null){

$stmt = $conn->prepare("
INSERT INTO notifications
(user_id,title,message,type,related_id,is_read,created_at)
VALUES (?,?,?,?,?,0,NOW())
");

$stmt->bind_param(
"isssi",
$user_id,
$title,
$message,
$type,
$related_id
);

$stmt->execute();

}
?>