We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19764
    • 4 Posts
    Hi.

    I am using MODx 0.9.6.1 with MySQL 5.0.22.
    Although this might be a kind of general SQL question, I would like to export webuser and webgroup database to one text file.

    All of data related to webusers are stored in 3 tables - modx_web_users, modx_web_user_attributes and modx_web_groups. Group names are also in modx_webgroup_names table.

    In my MODx site, each webuser belongs to one or more groups.
    For example, Tommy belongs to GROUP1, GROUP2 and GROUP3. John belongs to only GROUP1.
    Sometimes I add new groupnames.

    What I want to do is exporting from database to the following kind of combined text output. (format is not important)

    *Please see them in fixed font.

    Name GROUP1 GROUP2 GROUP3
    ------------------------------
    Tommy true true true
    John true false false
    Mike false true true

    or

    Name GROUP1 GROUP2 GROUP3
    ------------------------------
    Tommy GROUP1 GROUP2 GROUP3
    John GROUP1
    Mike GROUP2 GROUP3

    or

    Name groups
    ------------------------------
    Tommy GROUP1,GROUP2,GROUP3
    John GROUP1
    Mike GROUP2,GROUP3

    Does anyone have simple way to do this ?

    Thank you,