2 Mysql查询行数和主查询?

I'm trying to find a solution to have total rows affected of a query without the "limit" clause and the records of the query with limit clause... How to do that without 2 queries (count(*) and main query?

Thanks

EDIT: Here is my query:

$result = mysqli_query($link,"SELECT DISTINCT p.*
FROM posts p
JOIN abos a
ON p.userid = a.blogid OR p.userid = 11
LEFT JOIN posts_denied r
ON r.post_id = p.id AND r.userid = 11
WHERE (a.userid = 11 OR p.userid = 11)
  AND r.post_id IS NULL
ORDER BY p.id DESC
LIMIT 5");

Try with mysql_affected_rows like

mysql_query($sql_query);
echo "Number of rows effected = ".mysql_affected_rows();

See this LINK

And try to avoid using mysql_* functions due to they are deprecated.Instead use mysqli_* functions or PDO statements.