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 '' at line 8 Query: SELECT COUNT(user_id) total FROM march_madness_signups JOIN march_madness_users USING(user_id) WHERE march_madness_id= We are sorry but a database error has ocurred. The System Administrator has been notified.