We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32982
    • 674 Posts
    I’m looking for a database system to help me update and insert rows into a table
    and I found this software and I think it is very good. See the site is http://www.dadabik.org
    I´m looking for integration to modx.

    For those that are not php programers, it is a good thing to develop a "component customize". I’m not a programer but I want to use a wapper to allow me to use it within MODx. I think a good implementation in MODx would be to have a special folder
    with automatic pages which loads every row of the table dynamically (when the database increments
    new pages appers). This page could have a template engine in MODx to show the rows attractively. For the search it has a good function (only it doesn’t have multiselect).

    Well, I’m very new but if somebody could speek about the best integration or could take the idea for futute consideration with MODx, please have a look at it.

    Working on the autofolder idea I made a similar thing but now it doesn’t work...

    The idea is a general tv [*id*] whith the id of the table by @SELECT to a personal table I creatded in the MODx database.The others (for now one and don’t work) is another whith this @ post @SELECT nombre FROM modx_prueva WHERE (id = "[*id*]")

    If it works the only thing i need for create dynamic pages from a form is making a new page. Select the tv main "id" to the page to show (could be too name or another intead of id, more descriptive) and al others tv puting in my page (images prices names files ....) change to the row i select.

    I think this is a good idea, but for now doesn’t work for me.

    thanks and sorry for my english (note: slightly edited to clarify the English a bit, but more can be done)
      Jabiertxof (formerly XYZVISUAL)
      My bussines: http://marker.es
      https://www.youtube.com/user/jabiertxof/videos
      • 32963
      • 1,732 Posts
      Well, sadly you cant pass values to your TVs in TP3.

      I think you migth want to have a look at the @EVAL statment

      @EVAL
      $id = $modx->documentIdentifier;
      $result = $modx->db->getValue("SELECT nombre FROM modx_prueva  WHERE id = '".$id. "'");
      return $result;




        xWisdom
        www.xwisdomhtml.com
        The fear of the Lord is the beginning of wisdom:
        MODx Co-Founder - Create and do more with less.
        • 32982
        • 674 Posts
        sorry i work a lot of hours from your code and finaly test this
        @EVAL
        $result = $modx->db->getValue("SELECT nombre FROM modx_prueva");
        return $result;

        i simlified the code to maximun to find the error
        and this dont give me (test this code too)
        @EVAL
        $result = $modx->"name of the database"->getValue("SELECT nombre FROM modx_prueva");
        return $result;
        and dont worck
        this works
        @SELECT nombre FROM modx_prueva

        could help me?
          Jabiertxof (formerly XYZVISUAL)
          My bussines: http://marker.es
          https://www.youtube.com/user/jabiertxof/videos
          • 32963
          • 1,732 Posts
          whoops!

          Try this:

          global $modx;
          $result = $modx->db->getValue("SELECT nombre FROM modx_prueva");
          return $result;
            xWisdom
            www.xwisdomhtml.com
            The fear of the Lord is the beginning of wisdom:
            MODx Co-Founder - Create and do more with less.
            • 32982
            • 674 Posts
            it put me:
            « MODx Parse Error »
            MODx encountered the following error while attempting to parse the requested resource:
            « Execution of a query to the database failed - No database selected »
            SQL: SELECT nombre FROM modx_prueva
            [Copy SQL to ClipBoard]

            Parser timing
            MySQL: 0.0011 s s (4 Requests)
            PHP: 1123688207.2282 s s
            Total: 1123688207.2293 s s
            and the code is like you tell
            i dont know
              Jabiertxof (formerly XYZVISUAL)
              My bussines: http://marker.es
              https://www.youtube.com/user/jabiertxof/videos
              • 32963
              • 1,732 Posts

              The error was that no database was selected from within the query

              Try this:

              global $modx;
              $tbl = $modx->dbConfig['dbase']."modx_prueva";
              $result = $modx->db->getValue("SELECT nombre FROM ".$tbl);
              return $result;

                xWisdom
                www.xwisdomhtml.com
                The fear of the Lord is the beginning of wisdom:
                MODx Co-Founder - Create and do more with less.
                • 32982
                • 674 Posts
                if i put this code to Input Option Values:
                « MODx Parse Error »
                MODx encountered the following error while attempting to parse the requested resource:
                « Execution of a query to the database failed - No database selected »
                SQL: SELECT nombre FROM `carraiza_modx3`modx_prueva
                [Copy SQL to ClipBoard]

                Parser timing
                MySQL: 0.0020 s s (4 Requests)
                PHP: 1123705245.5834 s s
                Total: 1123705245.5854 s s
                and if i put in Default Value: it give me a no data
                in the two fields (default and option) it gives the first problem
                i dont know
                  Jabiertxof (formerly XYZVISUAL)
                  My bussines: http://marker.es
                  https://www.youtube.com/user/jabiertxof/videos
                  • 32963
                  • 1,732 Posts
                  Whoops!

                  You missed the dot (.)
                  between `carraiza_modx3’ and modx_prueva

                  See here:
                  SELECT nombre FROM `carraiza_modx3`.modx_prueva

                  The correct format is databasename.tablename
                    xWisdom
                    www.xwisdomhtml.com
                    The fear of the Lord is the beginning of wisdom:
                    MODx Co-Founder - Create and do more with less.
                    • 32982
                    • 674 Posts
                    this cide finaly works

                    @EVAL
                    global $modx;
                    $id = "2" ;
                    $result = $modx->db->getValue("SELECT nombre FROM `carraiza_modx3`.modx_prueva WHERE id = ’$id’");return $result;

                    but i want to remplace the variable $id for this code
                    $id=$modx->documentObject[description]

                    to dinamik select from database

                    and dont work

                    i test this code in a tv and in a snippet

                    (in the snipet)
                    global $modx;
                    $id=$modx->documentObject[description];
                    return $id;

                    (in the tv)
                    @EVAL global $modx; $id=$modx->documentObject[description]; return $id;

                    and in the snipet works well but in the tv dont give result
                    whats happend

                      Jabiertxof (formerly XYZVISUAL)
                      My bussines: http://marker.es
                      https://www.youtube.com/user/jabiertxof/videos
                      • 32982
                      • 674 Posts
                      i put the full code in a snippet and woks next to do is call from tv the snippet
                      another cuestion
                      could any one give data to make forms to database imput and edit from a tv
                      i read in documentation is posibol
                      realy the think i want is edit a row in the edit page mode whith the data in tv`s
                      and change if some values is wrong or old
                      i dont know if understand
                      thanks
                        Jabiertxof (formerly XYZVISUAL)
                        My bussines: http://marker.es
                        https://www.youtube.com/user/jabiertxof/videos