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 locations.id=1 and subs.leagueid=8 and subs.submissiontype=1 ' at line 5
SELECT users.id as userid, users.username,locations.name as locname, score FROM standings LEFT JOIN user_submissions subs on (subs.submissionid=standings.submissionid) INNER JOIN users ON (subs.userid=users.id) INNER JOIN locations ON (locations.id=subs.locationid) WHERE week= AND locations.id=1 and subs.leagueid=8 and subs.submissiontype=1 ORDER BY score DESC, winner desc, username LIMIT 0,25;