That's what I thought about fstream objects and getline(). I don't think add_user() is the problem; or perhaps I simply don't know how it could be. When I put cout << statements right below every readfriends >> instance it produced the output above. If add_user() was the problem, wouldn't only the variables used in it be affected? I don't see how that could change tmpname, for instance.
The problem is that when you read the tmpid readfriends >> tmpid; only the number is read from the file and the next read operation will start on the character after it, which is a new line character. When you read the tmpname getline(readfriends, tmpname); it finds a new line character right away so it stops reading and tmpname becomes an empty string.
You will have to discard the new line character before calling getline. This is often done by using the ignore member function but since you want to ignore the tab as well I think it's better to use std::ws.