SELECT SQL_CACHE tmp.id, tmp.price, tmp.exc_price, tmp.downloads, tmp.template_type_id, tmp.author_id, typ.name, aut.nick, sc.uri FROM templates AS tmp, types AS typ, authors AS aut, screenshots AS sc, rel_categories_templates AS rel_ct WHERE tmp.state = 1 && typ.id = tmp.template_type_id && aut.id = tmp.author_id && sc.uri LIKE '%-m.jpg' && sc.template_id = tmp.id && rel_ct.template_id = tmp.id && rel_ct.category_id = '2' ORDER BY tmp.id DESC LIMIT