I'm creating friend system,where users able to add as friend,accept friend request etc....
Table Structure
userfr_id(AUTO_INCREMENT)
user_id
friend_id
accepted(int 1)
Working functions
Friend request
Accept friend request
Display all friends..
Not Working functions
Now i'm try to delete users as follow method
But my problem is any method available to check user id and friend_id available row ??
sample date in table row
i couldn't use where in because filed name are different
Any help
Mayby just try with:
SELECT *
FROM table
WHERE ( ( user_id = 4 AND friend_id = 5 ) OR
( user_id = 5 AND friend_id = 4 ) )
AND accepted = 1
If it returns one row, there is friendship, otherwise, they are not friends.
SELECT * FROM table_name WHERE !(ISNULL([columnname]));
TRy this place your query and additional condition
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.