Размер файла: 542B
<?php
if(!isset($user)) {
header('location: /');
exit;
}
if($db->query("SELECT * FROM `friends` WHERE `id` = '". abs(intval($_GET['id'])) ."'")->rowCount() != 0)
{
$db->query("DELETE FROM `friends` WHERE `id` = '". abs(intval($_GET['id'])) ."' LIMIT 1");
$db->query("INSERT INTO `notify` SET `user_id` = '". abs(intval($_GET['id'])) ."', `from_id` ='". $user['id'] ."', `type` = 'notify_delete_friend', `read` = '0', `time` = '". time() ."'");
header('location: /friends/');
// print_r($db->errorInfo());
exit;
}
?>