<?php
	
	if ($_GET['send'] == 'ok' && mysql_result(mysql_query("SELECT COUNT(`id`) FROM `friends` WHERE `user_id` = '".$id."' AND `friend_id` = '".$user_id."' LIMIT 1"),0) == true)
	{		
		if (mysql_query("DELETE FROM `friends` WHERE `user_id` = '".$id."' AND `friend_id` = '".$user_id."'") == true && mysql_query("DELETE FROM `friends` WHERE `user_id` = '".$user_id."' AND `friend_id` = '".$id."'") == true)
		{
			mysql_query("UPDATE `users` SET count_friends=count_friends-1 WHERE `id` = '".$user_id."'");
			mysql_query("UPDATE `users` SET count_friends=count_friends-1 WHERE `id` = '".$id."'");
		}
		go(URL.'/?id='.$id);
	}

?>