Hello,
I tried to created a social networking system in which I created a part of adding friends so the problem I am having if the firend is not in his are like he searched a friend normally so that friend is not in his system so it show as add friend button but in actual it's not happening
<?php
$result = mysqli_query($connection,"SELECT * FROM friends WHERE (user_1='$uid' OR user_2='$uid') AND (user_1='$user' OR user_2='$user')");
while($row = mysqli_fetch_array($result)) {
$status = $row['status'];
if($status == '0') {
?>
<input type="button" class="btn btn-default friend" value="+ Friend Request Sent" disabled />
<?php } elseif ($status == '1') { ?>
<button type="button" class="btn btn-default friend" disabled><i class="fa fa-check"></i> Friends</button>
<?php } else { ?>
<form method="POST" action="viewp.php">
<input type="hidden" value="<?php echo $uid; ?>" name="friend" />
<input type="submit" class="btn btn-default friend" name="addfriend" value="+ Add Friend" />
</form>
<?php } }?>
Add a friend button is not working though what might be the problem if any thing is not clear please let me know so I will clearify more