29.10.2015, 15:41
You must either select DISTINCT results or do a check before adding anyone as a friend, whether he/she is already added or not. From what I see on your code currently, you can add a person as friend as many times you want and spam it in your dialog when /friends is executed.