We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7455
    • 2,204 Posts
    a bit off topic maybe but now I have this working is there a way to have a snippet create a coma seperated list of the webusers so I can import it into excel?
      follow me on twitter: @dimmy01
      • 7455
      • 2,204 Posts
      Is there an example on how to export a database table with a snippet to a cvs file?

      I want to use the RegisterX or the webuser register snippet to add people to the database so I can use this for a mailing list.
      but I have an external mailing list zo what I need is a wat to export the table as csv file I tryed exporting the table but then I also get all the sql command that I do not need.

      Could somone help me with this?

      Thanks Dimmy
        follow me on twitter: @dimmy01
        • 22303 MODX Staff
        • 10,725 Posts
        Do you mean producing this with a MODx snippet, or just exporting from phpMyAdmin -- if the latter, there is an export as CSV or CSV for Excel in the options...
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          mod note: posts from another topic merged, quote added for clarity
          Quote from: Dimmy at Aug 08, 2006, 02:39 PM

          a bit off topic maybe but now I have [RegisterX] working is there a way to have a snippet create a coma seperated list of the webusers so I can import it into excel?

          Yes. Get the list with a query, then build the csv file. I’ve done it. It’s not pretty. Here’s an example:

          http://www.modwest.com/help/kb6-135.html
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 7455
            • 2,204 Posts
            Thanks for the reply that pice of php does not use the modx db api.

            My client (manager user) needs to be able to export this information to make a mailing list.
            so a module would do the trick I think. But my php is just not that good.
            the backup module creates a database dump there I could select a database field, but then I still get the sql query commands.

            Maybe I am the only one who likes to use this?

            Dimmy
              follow me on twitter: @dimmy01
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              You can do it in a snippet, using the MODx API. That was just to show how it can be done. The one that I did was for a MODx system.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 22815
                • 1,097 Posts
                Quote from: Dimmy at Aug 09, 2006, 07:57 AM
                My client (manager user) needs to be able to export this information to make a mailing list.
                Hmmn. Now I know your actual requirements, this changes the ballgame slightly:
                1) This is going to be done multiple times..
                2) ...by non-technical people.
                3) If the list is being fed into an external mailing list system, then you most likely do not want to output everyone each time - that guy who joined in June might have already unsubscribed once and he doesn’t want to do it again.

                So ideally what you want is a Mailing List Exporter that "ticks off" users. Possibly checks to see if they agreed to be on the list.

                ALTERNATIVELY, you could build the list at the same time as people register. As well as having people sign up as webusers, save their details in a list somewhere. The download process would rename the list, and create a new blank list.

                Either way, it sounds like something a lot of people could benefit from and you may be better off starting a wishlist thread for this more specific requirement.
                  No, I don't know what OpenGeek's saying half the time either.
                  MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                  Forum: Where to post threads about add-ons | Forum Rules
                  Like MODx? donate (and/or share your resources)
                  Like me? See my Amazon wishlist
                  MODx "Most Promising CMS" - so appropriate!
                  • 22303 MODX Staff
                  • 10,725 Posts
                  Quote from: PaulGregory at Aug 09, 2006, 08:37 AM

                  So ideally what you want is a Mailing List Exporter that "ticks off" users. Possibly checks to see if they agreed to be on the list.

                  ALTERNATIVELY, you could build the list at the same time as people register. As well as having people sign up as webusers, save their details in a list somewhere. The download process would rename the list, and create a new blank list.

                  Either way, it sounds like something a lot of people could benefit from and you may be better off starting a wishlist thread for this more specific requirement.

                  Why not just create a web user group called Subscribers, and simply have members of that group be the list? It would be relatively easy to create a subscribe snippet and customize the signup form to manage those group membership records.
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    that’s what my RegisterX snippet does. You could check the code for that, and see how to access the user and group tables to get the data you want to format for csv.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org