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.

exp:query total results filtered by group_id ISSUE

February 11, 2014 7:56pm

Subscribe [1]
  • #1 / Feb 11, 2014 7:56pm

    3threeone

    4 posts

    I’m trying to write a query to get the total results of a channel with a specific ID and where the authors belong to a specific group id.

    I have this.

    {exp:query sql="SELECT COUNT(*) AS channel_total_results
    FROM
    exp_members
    INNER JOIN exp_channel_titles ON exp_members.member_id = exp_channel_titles.author_id
    WHERE
    exp_members.group_id = '{group_id}'
    AND
    channel_id = '2'
    AND
    status = 'active'"} {channel_total_results} {/exp:query}

    I’m not getting anything. Not sure if it’s because of the parsing order or not.

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

ExpressionEngine News!

#eecms, #events, #releases