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 'AS rubric FROM SC_aux_pages AS pages LEFT JOIN SC_rubrics AS rubrics ON pages.ru' at line 1
SELECT pages.*, rubrics.* AS rubric FROM SC_aux_pages AS pages LEFT JOIN SC_rubrics AS rubrics ON pages.rubric_id=rubrics.rubricID WHERE pages.aux_page_enabled=1 AND rubric_id != 0 ORDER BY RAND() ASC LIMIT 6