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");