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

    is the @SELECT limited to modx own MySQL tables or is it meant as a general way to include databazse queries to any table ?

    does @eval supports full blown (pages) of php code ? it seems awkward to paste it inside the small input area in the current interface.

    Should I save the code in a Snippet instead ?

    What is a general method for integrating an external php application
    (Html form for user data -> Select Update on MySQL tables -> HTML output ):
    as far as I understood from the docs, SNIPPETS seem more flexible;
    am I missing somerthing about Template Variables properties ?!??
      ----------------------------------------------------------
      http://www.linkedin.com/in/lucapost/
      http://www.twitter.com/lukwe/
      ----------------------------------------------------------
      • 15914
      • 145 Posts
      Quote from: lukwe at Feb 23, 2006, 04:12 PM


      is the @SELECT limited to modx own MySQL tables or is it meant as a general way to include databazse queries to any table ?

      does @eval supports full blown (pages) of php code ? it seems awkward to paste it inside the small input area in the current interface.

      Should I save the code in a Snippet instead ?

      EDIT: Yes, I believe the @SELECT is limited to the tables in the same database that MODx uses. <- I could be wrong!

      As for @EVAL, I quote Adam:

      Quote from: aNoble at Feb 22, 2006, 06:28 PM

      ...you could use @EVAL which allows you to write any PHP script you like. If you go that route I would suggest writing it in a separate PHP file and just including it from the @EVAL.
        Kunal Kapoor
        Technical Director
        Limesharp Internet Limited - Effective, Functional, Standards Compliant

        IRC Nick: KingKoopa
        Skype ID: KingKoopa16
      • actually, I think @SELECT will work with any DB. Or that’s how it should work anyways.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 1764
          • 680 Posts
          I could be wrong but I would gess that it would be any MySQL database that the MODx MySQL user has access to. To use another database you colud probably do
          USE some_other_database_name; SELECT * FROM some_table...;


          I know that you can do schema_name.table_name or database_name.table_name in some other databases but I don’t think that works with MySQL so you’d probably have to use the USE statement.

          Disclaimer: I have not tested any of this it’s just assumptions mixed in with my foggy memory. So I’m probably completely wrong tongue