Файл: html/functions/check_msg.php
Строк: 5
<?php
require_once '../system/connect.php';
if (isset($_GET['id_msg'])&&isset($user)) {
$thisMsgRes = $mc->query("SELECT * FROM `msg` WHERE `id` = '" . $_GET['id_msg'] . "'");
if ($thisMsgRes->num_rows > 0) {
$thisMsg = $thisMsgRes->fetch_array(MYSQLI_ASSOC);
if ($thisMsg['type'] == "mail") {
$mc->query("DELETE FROM `msg` WHERE `id_user`='".$user['id']."' && `type` = '" . $thisMsg['type'] . "'");
} else {
$mc->query("DELETE FROM `msg` WHERE `id` = '" . $_GET['id_msg'] . "'");
}
}
}
?>