Hi guys,
My project is chatting system in PHP and I need some help in delete friend from friend list I have already add friend function but remove friend does not work I don't know can any one help me quick
this is add friend code:
this code in utile page.
function addFriend($friendUsername){
$id = $_SESSION['id'];
$friendId = getUserId($friendUsername);
if (friendExists($friendId))
return;
$query = "INSERT INTO friends (userid, friendid) VALUES ('$id', '$friendId')";
mysql_query($query);
}
and this code in post page.
if (isset($_POST['addfriend'])){
if ($_POST['friend']!=""){
dbconnect();
addFriend($_POST['friend']);
} else {
$_SESSION['msg'] = $FRIEND_NOTSELECTED;
}
header('location: index.php?page=allusers');
}
tell me if u need more information...