ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to count the number of members (Resolved)

June 27, 2010 7:03am

Subscribe [2]
  • #1 / Jun 27, 2010 7:03am

    GlynD

    14 posts

    I am using this query:

    {exp:query sql="SELECT COUNT (member_id) AS member_count FROM exp_members"}
    {memberCount}
    {/exp:query}

    but getting this SQL error:

    Error Number: 1305

    Description: FUNCTION db.COUNT does not exist

    Has anybody else experienced this or know of a solution?

  • #2 / Jun 27, 2010 7:59am

    Wouter Vervloet

    758 posts

    Have you tried removing the space between ‘COUNT’ and the ‘(’?

    {exp:query sql="SELECT COUNT(member_id) AS member_count FROM exp_members"}
      {member_count}
    {/exp:query}

    Greetz,
    Wouter

  • #3 / Jun 27, 2010 8:18am

    GlynD

    14 posts

    Ahah! Works a treat now, thanks very much.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases