ok, well reading from one table and inserting to another should work fine.
I think I know what the problem is, but I don't know how to solve it.
So, above you see the dump schema for references. When user admin requests to be friend with another user for example "admin5", the num_rows is >= 0 and nothing would be inserted. But something should be inserted! (In this case $username = 'admin' & $add_friend = 'admin5')
However when a other user, not inserted in the db yet called "danny" for example wants to be friend with "pablo" num_rows would be <=0 and it would work.
So, I think that the query has to be rewritten, but i actually don't know how to do this.