Support forums

Please check @brandnewbox_uk for support status updates.

Search     Advanced Search

   
 
member_group  
Posted: 06 March 2012 04:54 PM —   [ Ignore ]  
Newbie
Rank
Total Posts:  11
Joined  2010-04-19

For some reason or other i dont seem to be able to pull out the member_group into this list.. the code below doesnt seem to work

{exp:ajw_export sql="SELECT screen_name, member_group, email FROM exp_members" format="csv" filename="memberlist.csv" 
Profile
 
 
Posted: 06 March 2012 05:14 PM —   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  1220
Joined  2006-04-12

Is it group_id rather than member_group?

Not online at the moment to check, sorry.

Andrew

Profile
 
 
Posted: 06 March 2012 05:59 PM —   [ Ignore ]   [ # 2 ]  
Newbie
Rank
Total Posts:  11
Joined  2010-04-19

Group_id seems to just return the number… so for example 8 or 9… where as i want the group.. its not super time sensitive Andrew.. just as and when you get chance.

Thanks

Profile
 
 
Posted: 06 March 2012 06:23 PM —   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  1220
Joined  2006-04-12

I think that ill be:

SELECT exp_members.screen_name
 
exp_member_groups.group_title
 
exp_members.email
FROM exp_members INNER JOIN exp_member_groups ON exp_members
.group_id exp_member_groups.group_id 

The member group name is in a different table

Andrew

Profile
 
 
Posted: 07 March 2012 11:43 AM —   [ Ignore ]   [ # 4 ]  
Newbie
Rank
Total Posts:  11
Joined  2010-04-19

Thanks Andrew… will give that a go! much appreciated.

Profile
 
 
Posted: 24 October 2013 04:15 PM —   [ Ignore ]   [ # 5 ]  
Newbie
Rank
Total Posts:  2
Joined  2012-08-27

Hi Andrew

I’m using the above query:

{exp:ajw_export
    sql
="SELECT exp_members.screen_name, exp_member_groups.group_title,  exp_members.email FROM exp_members INNER JOIN exp_member_groups ON exp_members.group_id = exp_member_groups.group_id"
    
format="csv" filename="member-export.csv"

Is there a way to export members from a single group only i.e. group ID 5 (members)

Cheers in advance

Profile
 
 
Posted: 25 October 2013 09:04 AM —   [ Ignore ]   [ # 6 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  1220
Joined  2006-04-12

Hi,

To export from only a single member group you can just add a:

WHERE exp_member_groups.group_id 

to the SQL, so:

{exp:ajw_export
    sql
="SELECT exp_members.screen_name, exp_member_groups.group_title,  exp_members.email FROM exp_members INNER JOIN exp_member_groups ON exp_members.group_id = exp_member_groups.group_id WHERE exp_member_groups.group_id = 5"
    
format="csv" filename="member-export.csv"

Andrew

Profile
 
 
Posted: 29 October 2013 12:12 PM —   [ Ignore ]   [ # 7 ]  
Newbie
Rank
Total Posts:  2
Joined  2012-08-27

Much thanks Andrew!

Profile
 
 
   
 
 

‹‹ EE1 Version      select specific fields ››

Select A Theme