15.11.2016, 15:34
Try not to nest so much if-statements inside one another. Makes code needlessly hard to read. What I assume you want is something like this: http://pastebin.com/167BUH99. This works on the principle of "INSERT IGNORE", assuming that the combination (FriendID, PlayerID) is the primary key. Much shorter and cleaner and IMO also more straightforward.