The query Failed
select * from winnersraceresults where trainerspage=1 and (restrainer="" or restrainer in (select regtrainername from trainerregisterednames where trainerid=)) order by racedate desc limit 30
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 ')) order by racedate desc limit 30' at line 1