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.

Query module get author_id for each channel entry

August 03, 2014 8:08am

Subscribe [1]
  • #1 / Aug 03, 2014 8:08am

    eigotec

    19 posts

    I am trying to get channel data for each user using the query add-on. I can’t see a column where the user entry is displayed (i’m trying to get data from a grid field. I’m guessing i have to do some sort of join to get the user_id?

    At the moment i have:

    SELECT COUNT(*) FROM exp_channel_grid_field_11 INNER JOIN exp_member_data WHERE `col_id_12` = 'Race' && `member_id` = '1'

    But this just returns the data for every user.

    Any ideas are appreciated, Thanks.

  • #2 / Aug 04, 2014 2:12pm

    eigotec

    19 posts

    Ok, so eventually I have got to this:

    {exp:query sql="SELECT COUNT(*) As races FROM exp_channel_grid_field_11 INNER JOIN exp_member_data WHERE `col_id_12` = 'Race' && `member_id` = '{member_id}'"}

    This, for some reason, gets me the total results of all members combined despite the where members id.

    I also have the same issue when using the channel tag and count.

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

ExpressionEngine News!

#eecms, #events, #releases