We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4172
    • 5,888 Posts
    There was a missing ’;’ at the end of line 4 in memberstable

    And in your Step 1 you have to modify the snippet, of course, for your needs!
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 14714
      • 84 Posts
      thanks ’bruno17’

      regarding the areas that need to be altered for my needs - i am taking a guess...

      <?php
      function eForm2db( &$fields )
      {
      /*---------------------------------------------------------------
      eForm2db
      Version: 0.1 [Beta 1]
      Author: pixelchutes
      ---------------------------------------------------------------
      Requirements:
      eForm 1.4+
      ---------------------------------------------------------------
      Use:
      - Takes validated eForm submittal data for use with the MODx DBAPI extender class.
      - Easily process database records referencing your form submission data:
      + INSERT new records to a table of your choice
      + UPDATE existing records if you’d prefer
      + DELETE records based on form submittal criteria
      + Form a query and return its record set as XML using $modx->db->getXML
      + Query a table’s MetaData using $modx->db->getTableMetaData, followed by an update query
      on only the form fields that are named after table columns!
      + and much more!
      ---------------------------------------------------------------*/

      // Bring needed resources into scope
      global $modx, $table_prefix;

      // Init our array
      $dbTable = array(); // key = DB Column; Value = Insert/Update value

      // Insert field/value pairs to insert/update in our table
      $dbTable[name] = $fields[suburb].’ ’.$fields[centre]; ’.$fields[street] ’.$fields[contact] ’.$fields[phone] ’.$fields[email] ’.$fields[website]


      // INSERT - $dbQuery = $modx->db->insert( $dbTable, $table_prefix . ’insertTableName’ );
      // UPDATE - $dbQuery = $modx->db->update( $dbTable, $table_prefix . ’updateTableName’ );
      // DELETE - $dbQuery = $modx->db->delete( $table_prefix . ’deleteFromTableName’, ’some_field = 1 AND name=\’’.$dbTable[name].’\’’, ’’ );
      // etc...

      // Run the db insert query
      $dbQuery = $modx->db->insert( $dbTable, $table_prefix . ’insertTableName’ );

      return true;
      }
      // Return empty string
      return ’’;
      ?>
        • 14714
        • 84 Posts
        i am getting this error on the call page..

        Parse error: syntax error, unexpected T_STRING in /home/communit/public_html/members/manager/includes/document.parser.class.inc.php(768) : eval()’d code on line 4

        below is line 4 of the php file...

        * Function: This class contains the main document parsing functions


        using this tag to call the table...

        [!memberstable? &region=`city`!]

        - this call is from the local database on the members site
          • 4172
          • 5,888 Posts
          The easiest way, if you have a table named ’modx_members’:

          You have created the table ’modx_members’ in your modx-database and added some testdatas with phpMyAdmin?

          And you have copied the new snippetcode for memberstable or have added the missing ’;’ to the end of line 4 in memberstable?
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 14714
            • 84 Posts
            yeah, from what i can see i have done all those points.

            (regarding the ’testdatas’ ) i have imported some of the current data into the table - would that be ok?


              • 14714
              • 84 Posts
              tried so many things!! but without any success.

              [!memberstable? &region=`north`!]

              the call function is giving me this...


              Parse error: syntax error, unexpected T_STRING in /home/communit/public_html/members/manager/includes/document.parser.class.inc.php(768) : eval()’d code on line 4
                • 4172
                • 5,888 Posts
                Did you clear the Cache?
                And what do you get when you use only this code in memberstable:

                <?php
                $result=$modx->db->select('*',$modx->getFullTableName('members') );
                $rows=$modx->db->makeArray($result);
                print_r($rows);
                return;
                ?>
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 14714
                  • 84 Posts
                  Did you clear the Cache?

                  the database or in modx either one i don’t know where it is.
                    • 14714
                    • 84 Posts
                    i think i am getting closer...

                    « MODx Parse Error »

                    MODx encountered the following error while attempting to parse the requested resource:
                    « Execution of a query to the database failed - Table ’communit_members.membersmembers’ doesn’t exist »
                    SQL: SELECT * FROM `communit_members`.`membersmembers`
                    [Copy SQL to ClipBoard]

                    Parser timing
                    MySQL: 0.0068 s (0 Requests)
                    PHP: 0.0281 s
                    Total: 0.0350 s
                      • 4172
                      • 5,888 Posts
                      this looks very strange

                      your databasename is: communit_members ?
                      your table_prefix: members ?

                      So your tablename is membersmembers ?

                      Is that right ?

                      You are sure you have the table membersmembers created in the database communit_members ?
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!