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.

Possible to assign custom member field value to multiple members at once?

March 11, 2012 7:21pm

Subscribe [2]
  • #1 / Mar 11, 2012 7:21pm

    benek

    189 posts

    My situation is that I have a site with many members already created. After those members were created I’ve had to add an additional custom member field. All new member registrations will be required to fill in this field. But all old members have no value in this field.

    There are too many old members to edit each one individually to add a field value, but it’s a required field so it must be done. Is there a way to edit them in bulk? I want all members in this one member group to have the exact same value in that field, so I’d like to find a way to change them all at once.

    Is this possible in EE? Do I need to do a custom SQL query?

    Any help would be greatly appreciated. I need to get this sorted out in the next few days.

    Cheers,
    Benek

  • #2 / Mar 12, 2012 2:55pm

    Shane Eckert

    7174 posts

    Hey benek,

    Thank you for posting your question.

    I believe an SQL query is your best bet here. You are right. Just be sure to backup the database first! You never know what can happen. If you want I can move this to the Community Help Forum to see if anyone can help you craft that query.

    Let me know!

    Is there anything else I can help with?

    Cheers,

  • #3 / Mar 12, 2012 3:05pm

    benek

    189 posts

    Yes please move it I need help with the query

  • #4 / Mar 12, 2012 7:44pm

    Sean C. Smith

    3818 posts

    Hi Benek,

    Have moved this thread to Community help at your request.

    Sean

  • #5 / Mar 12, 2012 7:45pm

    benek

    189 posts

    Thanks Sean.

    Can anyone help me out writing a SQL query as described above?

  • #6 / Mar 12, 2012 10:45pm

    Bhashkar Yadav

    727 posts

    Hi Benek,

    you can run the sql query as

    UPDATE exp_member_data, exp_members SET m_field_id_{field-id}='{value-need-to-be-updated}' WHERE exp_member_data.member_id=exp_members.member_id AND exp_members.group_id={group-id}

    replace {field-id}, {value-need-to-be-updated} and group-id} according to your preference.

    Hope this would help you.

  • #7 / Mar 14, 2012 6:53pm

    benek

    189 posts

    That worked perfectly, thank you.

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

ExpressionEngine News!

#eecms, #events, #releases