SELECT,, t2.filename, t2.video_thumb FROM `andspanish_dtools_doc_center_document_categories` AS t1 JOIN `andspanish_dtools_doc_center_documents` AS t2 ON t1.document_id = WHERE t1.category_id = AND t2.file_type = 'video' ORDER BY t1.order : 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 t2.file_type = 'video' ORDER BY t1.order' at line 1