Expressionengine Members w/ entries count
Easy query to find the number of members with entries
{exp:query sql="
SELECT count(*) AS num_members
FROM exp_members m
JOIN exp_channel_titles t on t.author_id = m.member_id
Where channel_id='CHANNEL_ID_HERE'"}
{num_members}
{/exp:query}
Maybe you have a channel with a specific status as well?
Example, you have Members who are creating goals, those "goal" entries can either be set to goalset or goalcomplete
you can then find the members that have set goals with
{exp:query sql="
SELECT count(*) AS num_members
FROM exp_members m
JOIN exp_channel_titles t on t.author_id = m.member_id
Where channel_id='CHANNEL_ID_HERE' AND status='goal_set' "}
{num_members}
{/exp:query}
or the members who have completed goals
{exp:query sql="
SELECT count(*) AS num_members
FROM exp_members m
JOIN exp_channel_titles t on t.author_id = m.member_id
Where channel_id='CHANNEL_ID_HERE' AND status='goal_complete' "}
{num_members}
{/exp:query}
Written by Jake Chapman
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Expressionengine
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#