Now I do it through two requests, using a loop to find the number of attached articles for each tag.
define("SQL_QUERIES_TAGS_LIST", " SELECT * FROM `tags` ORDER BY `name` "); define("SQL_QUERIES_TAGS_COUNT", " SELECT count(*) as `count` FROM `n_t` WHERE `n_t`.`id_tag` = ? GROUP BY `id_tag` "); n_t is a table of links with numbers of tags and articles.
+ Should be returned and tags with the number 0, which have no related articles.