-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremove_friend.php
More file actions
33 lines (25 loc) · 985 Bytes
/
remove_friend.php
File metadata and controls
33 lines (25 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
//enable this when finished
//error_reporting(0);
session_start();
if (file_exists('config.php')) {
include('config.php');
}
else {
include('../../config.php');
}
$conn = mysql_connect($sqlHost, $sqlUser, $sqlPass) or die("Can't connect to host : " . mysql_error());
$db = mysql_select_db($sqlDatabase, $conn) or die("Can't database to database: " . mysql_error());
$error = "";
$friend_id= $_POST['friend_id'];
$user_id= $_SESSION['login_user'];
$friend_id = stripslashes($friend_id);
$friend_id = mysql_real_escape_string($friend_id);
$user_id = stripslashes($user_id);
$user_id = mysql_real_escape_string($user_id);
$sql = "DELETE FROM Friends WHERE User_ID = ".$user_id." and Friend_ID = ".$friend_id;
$execute = mysql_query($sql, $conn) or die($sql . " : " . mysql_error());
$sql = "DELETE FROM Friends WHERE User_ID = ".$friend_id." and Friend_ID = ".$user_id;
$execute = mysql_query($sql, $conn) or die($sql . " : " . mysql_error());
mysql_close($conn);
?>