You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND apv3_menu.in_menu = '1' AND apv3_pages.lang = 'en' ORDER BY...' at line 5
SELECT apv3_menu.alias, apv3_menu.user_only, apv3_pages.name FROM apv3_menu, apv3_menu_pages, apv3_pages WHERE apv3_menu.id = apv3_menu_pages.id AND apv3_menu.id = apv3_pages.id AND apv3_menu_pages.parent_id = AND apv3_menu.in_menu = '1' AND apv3_pages.lang = 'en' ORDER BY apv3_menu_pages.p_id