• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

MySQL count vs PHP count

chrisj

Active member
#1
Why would xenforo use mysql count and add an extra query?

For example XenForo_ControllerPublic_Member actionIndex gets an array of all the users with getUsers and then it calls countUsers as well.
 
S

Syndol

Guest
#2
Because in this case getUsers() is only fetching X number of members as indicated by the 'perPage' and 'page' parameters, while countUsers() fetches the total count of (valid none banned) members.