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 'AND Stavki.IDt_stav=Turnir.IDt AND Spisok_chlenov.ID=-1 AND Spisok_chlenov.Name' at line 1