SELECT * FROM marvel_content.discussion_relations dcr WHERE dcr.content_id = AND dcr.content_type = 'video' LIMIT 0,1 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 dcr.content_type = 'video' LIMIT 0,1' at line 4