EDIT:
Here is my table:
[user_friend] table:
- id, -user_id
- friend_id
- time
[late] table:
- id
- user_id
- reason
- check_in_time
Now, let's just say the current user's id is '1', I want to search the table user_friend for all the rows with the user_id of '1' then put all the friend_id all the rows with user_id of '1' in a var or something(Let's just say there 3 rows with the friend_id of 2,3 $ 4 respectively).
Now I want to get the id of the rows in the late table with the user_id of any of the current user's friend's id(For this case it's 2,3 & 4). Hope it helps