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

Easy Way To Get Highest User ID?

Discussion in 'XenForo Development Discussions' started by James, May 31, 2011.

  1. James

    James Well-Known Member

    What's the easiest way to get the highest registered user ID in XF for use in PHP code?
  2. Mike

    Mike XenForo Developer Staff Member

    Via a query:

    SELECT MAX(user_id) FROM xf_user
  3. James

    James Well-Known Member

    So there's no predefined function? Alright, thanks Mike :)
  4. Mike

    Mike XenForo Developer Staff Member

    No, as IDs really aren't of interest to us except for looking up particular ones. If you want the most recently registered user (meeting our necessary criteria), that's a different story...
    James likes this.

Share This Page