I need help with SQL query.
I have two tables. One is users and other one is userfriends
users table:
aid email firstname
1
[email protected] example
2
[email protected] example2
3
[email protected] example3
4
[email protected] example4
userfriends tables:
reqid email friendemail status
1
[email protected] [email protected] 1 (example1 is frnds with example2)
2
[email protected] [email protected] 2 (example2 request pending)
3
[email protected] [email protected] 1 (example1 is frnds with example3)
4
[email protected] [email protected] 1 (example1 is frnds with example4)
So when status is 2 the add request is pending and at status 1 they are friends. What i want is that i want to retrieve the complete friendlist for user example1. I want to pull out names from users table for corresponding output from previous query to display as friendlist.