I have this MySQL table:

Let’s imagine I am logged in as user 1 and I’m browsing the profile of user 2. As we are mutual friends (1 is friend with 2 and 2 is friend with 1), I need to echo “friends.”
When I browse the profile of user 4, whose friendship I have requested, but they haven’t accepted yet, I need to echo “friend requested.”
When browsing any other user, I need to echo “add friend.”
I can do the PHP part, I just don’t know how to do the MySQL query.
When
countisuseris you – you requested that person friendshipuseris that person – you are being requested for friendship by that person