-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfollow_function.php
33 lines (22 loc) · 967 Bytes
/
follow_function.php
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
include "db_connect.php";
function follow()
{
$following_query = "UPDATE blog_login SET ";
$following_query .= "following = '$search'";
$following_query .= "WHERE name = '$name'";
$following_result = mysqli_query($connection,$following_query);
if(!$following_result)
{
die('Query Failed'.mysqli_error($connection));
}
$followers_query = "UPDATE blog_login SET ";
$followers_query .= "followers = '$name'";
$followers_query .= "WHERE name = '$search'";
$followers_result = mysqli_query($connection,$followers_query);
if(!$followers_result)
{
die('Query Failed'.mysqli_error($connection));
}
}
?>