Mutual friends are not displayed because of sql error

Mutual friends section in Friends tab in profile never displays mutual friends because of SQL error.

http://phpbbsocialnetwork.com/viewtopic.php?f=44&t=4677