Ошибка при возвращении запроса!
SELECT SQL_CALC_FOUND_ROWS m.*, t.name as type, mst.name as subtype, mst.foto as subtype_foto, a.name as area, p.idarea as pidarea, (case when p.idlevel = 1 then NULL else p.name end) as parea, p1.idarea as ppidarea, (case when p1.idlevel = 1 then NULL else p1.name end) as pparea, u.fio as user FROM new_materials m join new_materials_types t on t.idmaterials_type = m.idmaterials_type left outer join new_materials_subtypes mst on mst.idmaterials_subtype = m.idmaterials_subtype join new_area a on a.idarea = m.idarea left outer join new_area p on p.idarea = a.idparent left outer join new_area p1 on p1.idarea = p.idparent left outer join new_users u on u.iduser = m.iduser where t.idmaterials_type in (1,4,5,6,7,9,14,26,22) and m.deleted = 0 and m.idmoder is not null and (a.idarea = 562 or a.idparent = 562 or p.idparent = 562 or p1.idparent = 562) order by m.date desc, m.idmaterial desc LIMIT 0, 20