<?php
include"../../sys/fnc.php";
if(!empty($_POST[id]) and !empty($_POST[msg]))
{
    $res=$db->query("select * from `book` where `id`='$_POST[id]'");
    $pole = $res->fetch_array();
    
    
    if($user[leval]==4 or $user[user]==$pole[name])
    {
        $db->query("update `book` set `msg`='$_POST[msg]' where `id`='$_POST[id]'");
        echo'Успешно отредактировано';
    }else{echo'Не достаточно прав для редактирования!';}
}
?>