SELECTCOUNT(*) FROM (SELECTp.id,p.title,p.cover,p.text,p.url,p.published,p.date,c.idAScategory_id,c.nameAScategory_name,a.urlASauthor_url,a.nameASauthor_name,a.avatarASauthor_avatar, (SELECTCOUNT(m.id) FROMblog_post_commentsmWHEREm.post_id=p.idANDm.approved=1) AScomments_countFROMblog_postspINNER JOINblog_categoriescONp.category_id=c.idINNER JOINblog_authorsaONp.author_id=a.idINNER JOINblog_tagstONt.post_id=p.idWHERE (t.tag_id=?) AND (p.published=?) ORDER BYp.priority,datedesc) tmp
SELECTCOUNT(*)
FROM
(
SELECTp.id,p.title,p.cover,p.text,p.url,p.published,p.date,c.idAScategory_id,c.nameAScategory_name,a.urlASauthor_url,a.nameASauthor_name,a.avatarASauthor_avatar,
(
SELECTCOUNT(m.id)
FROMblog_post_commentsmWHEREm.post_id=p.idANDm.approved=1
) AScomments_countFROMblog_postspINNER JOINblog_categoriescONp.category_id=c.idINNER JOINblog_authorsaONp.author_id=a.idINNER JOINblog_tagstONt.post_id=p.idWHERE
(t.tag_id=?)
AND (p.published=?)
ORDER BYp.priority,datedesc
) tmp
SELECTCOUNT(*) FROM (SELECTp.id,p.title,p.cover,p.text,p.url,p.published,p.date,c.idAScategory_id,c.nameAScategory_name,a.urlASauthor_url,a.nameASauthor_name,a.avatarASauthor_avatar, (SELECTCOUNT(m.id) FROMblog_post_commentsmWHEREm.post_id=p.idANDm.approved=1) AScomments_countFROMblog_postspINNER JOINblog_categoriescONp.category_id=c.idINNER JOINblog_authorsaONp.author_id=a.idINNER JOINblog_tagstONt.post_id=p.idWHERE (t.tag_id=1) AND (p.published=1) ORDER BYp.priority,datedesc) tmp;