We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26334
    • 77 Posts
    I have just read all the DBAPI doco and it explains why DBAPI functions should be used when writing snippets rather than SQL queries etc and I can see that makes sense but .......... I can’t find any way under the API to do a LEFT JOIN or similar.

    Is there a way to do this?

    Or do I just have to go back to standard sql commands in my php.

    Thanks.
      • 22303 MODX Staff
      • 10,725 Posts
      The DBAPI doesn’t cover complex query building, but certainly allows you to send any SQL that is valid for the mysql extension via the query() function.

      If you are looking for a more robust API into the MODx core tables, or developing a simple object/relational model of some custom tables, you might explore xPDO, on which the upcoming 0.9.7 release of MODx has been reconstructed. Support available right here in these forums via http://modxcms.com/forums/index.php/board,219.0.html.
        • 26334
        • 77 Posts
        Thanks, ok it looks like query() will be the way to go for me then. I am writing my own snippet with my own DB tables so query will do the job but I wanted to make sure there wasn’t more extensive API functions that I had missed somehow.

        Thanks.