We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14796
    • 59 Posts
    Hey Everyone,

    I created my own mysql database that needs to be integrated into modx. It works fine outside of modx, just can’t figure out how to integrate it.

    Will Pay, negotiable.

    Thanks,

    Josh
      • 23072
      • 150 Posts
      Do you have a bit more information? What’s in the database, how you want it integrated etc?
        Notanotherdotcom Ltd

        Web | Print | Marketing
        • 33372
        • 1,611 Posts
        You might take a look at how MaxiGallery is set up. It uses its own table within the MODx database and runs queries on it to add/edit/delete information. You’ll find examples of all of the code you need to access your database in there, assuming you combine it with the MODx database (separate tables, same database).

        Doing it this way has some advantages, including that it’s very easy and you can backup your custom database using the Manager’s backup feature. But if you like you can also keep it completely separate and just connect to it when necessary. I don’t recommend you do this unless there’s a compelling reason, however, since it complicates the task slightly.

        I bet that if you give us a little more info we can help you to do this on your own (which would be more satisfying, and cheaper, too).
          "Things are not what they appear to be; nor are they otherwise." - Buddha

          "Well, gee, Buddha - that wasn't very helpful..." - ZAP

          Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
          • 7923
          • 4,213 Posts
          And Susan has a tutorial on her site how to do a database managing module (www.sottwell.com)


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 14796
            • 59 Posts
            I actually wanted to keep the database separate. It’s a database for a directory and will have business listings, etc. The reason I wanted it to be within modx is so I can take advantage of the login/logout functions, user comments on business listings, and the star rating snippets, maybe even the google maps.

            So far I tried using the ModxApi to see if I can keep it separate and incorporate it from the outside (the directory database and the pages work fine outside of modx).

            I hope this is a better explanation. And thanks Zap and Doze for the helpful information. I’m actually going to follow Susan’s article and see if I can get it done from that.

            In the meantime if any one else has any more helpful pointers it will be greatly appreciated smiley

            Thanks,

            Josh
              • 11975
              • 2,542 Posts
              Hi,

              if you need to access another DB from MODx, read this article.

              http://wiki.modxcms.com/index.php/Access_another_database_from_MODx

              :-)
                Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                • 14796
                • 59 Posts
                I understand how to access a separate database, but still not successful in what I want to do sad

                If anyone can help more, it will be greatly appreciated!

                Thanks,

                Josh
                  • 7923
                  • 4,213 Posts
                  The building blocks for what you want to do are right there. Did you notice that Susan’s tutorials also have files that you can download to see how the accessing to the DB is done.. and if you want the info to be shown in front page, you need to use dbapi for example to query the data and build the desired output out of it within a snippet. There is no magical snippet around that will query your external database tables and show it in a format that you like straight away. MakeTable and some of the TV widgets can build a table views though, but I bet that’s not what you want.. So it’s just a matter of putting your php cap on and start coding!


                    "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                    • 14796
                    • 59 Posts
                    Lol...I would put my php cap on if I knew php smiley

                    Unfortunately my skills are incredibly limited, as I don’t really know the language. I did download Susan’s example and tried reading it to see what’s going on, but no luck.

                    Anyways, I do appreciate the advise.

                    I’m still Willing to Pay if anyone from the Modx Development team or testers are interested.

                    Thanks,

                    Josh
                      • 7923
                      • 4,213 Posts
                      Oh, I thought that you knew some php.. well in that case, I hope you will get someone to help, unless you are willing to do some studying yourself, plenty of php books out there wink


                        "He can have a lollipop any time he wants to. That's what it means to be a programmer."