You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rank JOIN socisCAT AS fofi JOIN aa_Ranking_competis AS rc ON fofi.id = rank.id_s' at line 1