vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   A query to pull just Registered Users email from Users Table (https://vborg.vbsupport.ru/showthread.php?t=158754)

caliman 09-25-2007 05:32 PM

A query to pull just Registered Users email from Users Table
 
Hi all - thanks in advance... I was curious if anyone could save me a bit of time from tracking down all the normalization...


I am looking for a query to pull just Registered Users email from Users Table.


Any help is greatly appreciated.

caliman

Eikinskjaldi 09-25-2007 11:01 PM

Depends on your definition of "registered user". Do you mean just member group 2, or do you want to include admins or other custom usergrops?

select username, email from user where usergroupid in (list,of,allowed,groups)

caliman 09-26-2007 01:44 AM

Thank you!
I meant just 2, but I hadn't actually thought about me or my mods.

--------------- Added at 21:03 ---------------

Ok... I admit I was being lazy... I looked all this up... in addition to what you stated as the query, here are the actual groups.. perhaps this will help other lazy people. :)

Code:

mysql> desc usergroups;
+------------+-------------+------+-----+---------+----------------+
| Field      | Type        | Null | Key | Default | Extra          |
+------------+-------------+------+-----+---------+----------------+
| groupid    | int(5)      |      | PRI | NULL    | auto_increment |
| groupname  | varchar(50) |      |    |        |                |
| cpaccess  | smallint(3) |      |    | 0      |                |
| modaccess  | smallint(3) |      |    | 0      |                |
| uploads    | smallint(3) |      |    | 1      |                |
| comments  | smallint(3) |      |    | 1      |                |
| diskspace  | int(10)    | YES  |    | NULL    |                |
| uploadsize | int(10)    | YES  |    | NULL    |                |
| uplimit    | int(5)      |      |    | 0      |                |
| editpho    | int(3)      |      |    | 0      |                |
| editposts  | int(3)      |      |    | 0      |                |
| useralbums | int(3)      |      |    | 0      |                |
| reqmod    | int(3)      |      |    | 0      |                |
| canassign  | int(3)      |      |    | 0      |                |
+------------+-------------+------+-----+---------+----------------+
14 rows in set (0.02 sec)

mysql> SELECT * FROM usergroups;
+---------+-----------------------------------+----------+-----------+---------+----------+-----------+------------+---------+---------+-----------+------------+--------+-----------+
| groupid | groupname                        | cpaccess | modaccess | uploads | comments | diskspace | uploadsize | uplimit | editpho | editposts | useralbums | reqmod | canassign |
+---------+-----------------------------------+----------+-----------+---------+----------+-----------+------------+---------+---------+-----------+------------+--------+-----------+
|      1 | Unregistered / Not Logged In      |        0 |        0 |      0 |        0 |        0 |          0 |      0 |      0 |        0 |          0 |      0 |        0 |
|      2 | Registered Users                  |        0 |        0 |      1 |        1 |    50000 |      1000 |      20 |      1 |        1 |          1 |      0 |        0 |
|      3 | Users Awaiting Email Confirmation |        0 |        0 |      0 |        0 |        0 |          0 |      0 |      0 |        0 |          0 |      0 |        0 |
|      4 | (COPPA) Users Awaiting Moderation |        0 |        0 |      0 |        0 |        0 |          0 |      0 |      0 |        0 |          0 |      0 |        0 |
|      5 | Super Moderators                  |        0 |        0 |      0 |        0 |        0 |          0 |      0 |      0 |        0 |          0 |      0 |        0 |
|      6 | Administrators                    |        1 |        0 |      1 |        1 |        0 |          0 |      0 |      1 |        1 |          1 |      0 |        1 |
|      7 | Moderators                        |        0 |        0 |      0 |        0 |        0 |          0 |      0 |      0 |        0 |          0 |      0 |        0 |
|      8 | Banned Users                      |        0 |        0 |      0 |        0 |        0 |          0 |      0 |      0 |        0 |          0 |      0 |        0 |
|      (edited)    | (Your site) Moderator                  |        0 |        1 |      1 |        1 |    50000 |      20000 |      20 |      1 |        1 |          1 |      0 |        0 |
+---------+-----------------------------------+----------+-----------+---------+----------+-----------+------------+---------+---------+-----------+------------+--------+-----------+
9 rows in set (0.01 sec)

mysql>

May be slightly hard to read but you should see the groupids rather easily.

caliman

Eikinskjaldi 09-26-2007 03:38 AM

Actually on my board I have a handful of extra custom groups, which is why I asked the question

caliman 09-26-2007 03:41 AM

Aye. I hadn't thought of that either. lol.

This wine is good.

Marco van Herwaarden 09-26-2007 08:33 AM

If you are really being lazy and only want the email addresses:

AdminCP -> Users -> Generate Mailing List

caliman 09-26-2007 12:52 PM

Nice Marco!


All times are GMT. The time now is 01:05 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01904 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete