Database Problem

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 4
SELECT sites.id, sites.title, sites.url, sites.imgurl, sites.urlrss, sites.facebook, sites.googleplus, sites.twitter, sites.youtube, sites.urlmobile, sites.cat, sites.country, sites.language, sites.city, sites.type, sites.plot, userdata.data_id as favorite FROM sites LEFT JOIN userdata ON userdata.data_id = sites.id AND userdata.cat_data = "site" AND userdata.user_id = 10000 WHERE sites.id =