database A = members names
Database B = Friends of members
When a user logs into mysql, the server finds all records of that user's friends in database B. Then for each record, it has to make a query in database A to get the name belonging to the record.
Problem is, if user has 1000 friends, I need to make 1000 requests to database getting all the names.
Is there any way to do this with just one request somehow