Announcement

Collapse
No announcement yet.

Remove All With A Certain Email Type

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Remove All With A Certain Email Type

    Is it possible to remove all users with a certain kind of email address, For example remove everyone who has an email such as @spam.com ?
    PC Repair Poole - Web Directory - Diabetes Forum

  • #2
    I recommend you run a query to put those users into a new group, then prune by group. Use this query:

    Code:
    UPDATE user
    SET usergroupid = X
    WHERE email LIKE '%@spam.com%'
    Where X is the usergroupid of the new group. Now prune by group:

    Admin CP -> Users -> Prune / Move Users

    Comment


    • #3
      hi

      when i am running this query in SQL, it is saying

      An error occurred while attempting to execute your query. The following information was returned.
      error number: 1054
      error desc: Unknown column 'X' in 'field list'

      Comment


      • #4
        Change X to the usergroupid of the destination group which you will later prune.

        Comment


        • #5
          Excellent.
          thanks for that tip Jake

          If only this could be accomplished via "Search For Users" using the email field then the results could be pruned, it would make life so much easier.

          Comment


          • #6
            Originally posted by ximcix View Post
            Excellent.
            thanks for that tip Jake

            If only this could be accomplished via "Search For Users" using the email field then the results could be pruned, it would make life so much easier.
            Pop it in the Suggestions forum....
            Vote for:

            - *Admin Settable Paid Subscription Reminder Timeframe*
            -
            *PM - Add ability to reply to originator only*
            - Add Admin ability to auto-subscribe users to specific channel(s)
            - Highlight the correct navigation tab when you are on a custom page
            - "Quick Route" Interface...
            - Allow to use custom icons for individual forums

            Comment


            • #7
              Can anyone provide guidance on how to apply this query to a custom profile field? Here is what I have:
              Code:
               
               
              UPDATE user
              SET usergroupid = 10
              WHERE $bbuserinfo[field6] LIKE '%html%'
              This gives me a SQL syntax error.
              Thanks in advance.

              Comment


              • #8
                Try this...
                Code:
                UPDATE
                    user
                LEFT JOIN
                    userfield
                ON
                    user.userid = userfield.userid 
                SET 
                    usergroupid = 10
                WHERE 
                    userfield.field6 LIKE '%html%'
                Lats...

                Comment


                • #9
                  Thank you so much for the quick response, this worked like a charm!

                  Comment


                  • #10
                    Glad it worked for you
                    Lats...

                    Comment

                    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                    Working...
                    X