We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50265
    • 13 Posts
    Hello
    I am new to MODx so please excuse the newbie question. I want to read data from an external DB into a MODx resource. I've done some reading and I can see that it's possible to read data from an external DB on localhost. But is it possible to pull data from a mySQL DB which sits on a server on a different web host?
    Thanks, Tony

    This question has been answered by BobRay. See the first response.

    • discuss.answer
      • 3749
      • 24,544 Posts
      One way to do that is to put a .php file on the remote that returns the data in JSON format and call it from the resource with Ajax. If the data is at all sensitive, you'd want to have a secure, hashed, key to send along with the request.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 50265
        • 13 Posts
        Quote from: BobRay at Apr 11, 2015, 03:43 AM
        One way to do that is to put a .php file on the remote that returns the data in JSON format and call it from the resource with Ajax. If the data is at all sensitive, you'd want to have a secure, hashed, key to send along with the request.

        What a great idea! Thank you. I will ask one of my guys to implement it.