DATABASE ERROR:

SELECT con.*,
                       con.pubdate as fpubdate,
					   cat.title as cat_title, cat.seolink as catseolink,
					   cat.showdesc,
                       u.nickname as author,
                       u.login as user_login
                FROM cms_content con
				INNER JOIN cms_category cat ON cat.id = con.category_id
				LEFT JOIN cms_users u ON u.id = con.user_id
                WHERE con.is_arhive = 0
                       AND (cat.NSLeft >= '64' AND cat.NSRight <= '65' AND cat.parent_id > 0)
 AND (con.showlatest = 1)
 AND (con.published = 1 AND con.pubdate <= '2017-05-24 03:23:36' AND (con.is_end=0 OR (con.is_end=1 AND con.enddate >= '2017-05-24 03:23:36')))


                

                ORDER BY con.pubdate DESC
LIMIT 0, 50

Out of resources when opening file '/tmp/#sql_5acc_0.MYI' (Errcode: 24 - Too many open files)