Query to find out deactivated users

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • avdhesh
    New Member
    • Feb 2005
    • 28
    • 3.0.6

    Query to find out deactivated users

    Can you please help me build a query to find all userid in user table which are deactivated
    OR
    users who have disabled "Receive Email from Administrators" option.

    Actually I want to generate a mailing list and want to remove these users from the list.
  • Lats
    Senior Member
    • Mar 2002
    • 3671

    #2
    This will select user who have opted to receive admin emails - best to run in phpmyadmin and export the results to your newletter app.
    Code:
    SELECT
        username,
        email
    FROM
        user
    WHERE
        (options &16)
    ORDER BY
        username
    To delete the rest who didn't select to receive admin emails, create a new usergroup and run this query...
    Code:
    UPDATE
        user
    SET
        usergroupid = [COLOR=blue]X
    [/COLOR]WHERE NOT (options &16)
    Change X to the new usergroupid, then prune the users in that usergroup.
    Lats...

    Comment

    • avdhesh
      New Member
      • Feb 2005
      • 28
      • 3.0.6

      #3
      Thanks

      Many a thanks Lats, It worked.

      Comment

      • Lats
        Senior Member
        • Mar 2002
        • 3671

        #4
        Excellent news - thanks for letting me know.
        Lats...

        Comment

        • LEARNER29
          Senior Member
          • Nov 2001
          • 316
          • 3.6.x

          #5
          Originally posted by Lats
          This will select user who have opted to receive admin emails - best to run in phpmyadmin and export the results to your newletter app.
          Code:
          SELECT
              username,
              email
          FROM
              user
          WHERE
              (options &16)
          ORDER BY
              username
          To delete the rest who didn't select to receive admin emails, create a new usergroup and run this query...
          Code:
          UPDATE
              user
          SET
              usergroupid = [COLOR=blue]X[/COLOR]
          WHERE NOT (options &16)
          Change X to the new usergroupid, then prune the users in that usergroup.

          thank you. this answered my question.
          .

          Comment

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