We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 47630
    • 56 Posts
    I'm new to Modx but I feel I am really progressing with using MIGX now, I can create the data & dIsplay it on the front end with BLOX smiley

    However, I still have one issue integrating a 3rd party form with MYSQL table created by MIGX.

    The problem I have is with a mismatched auto incrementing field;

    MIGX cretes this field as 'id'
    My external form creates it as '_rowid_'

    In the external form, I have tried changing all the php values from _rowid_ to id, but this did not work so I am hoping I can do this the other way around by changing the field id in MIGX to _rowid_

    I tried previously integrating MIGX into the MYSQL table created by the 3rd party form builder but this also failed because of this mismatch in primary field id.

    So, my question is; Is it possible to change the primary auto incrementing field id in MIGX from id to _rowid_?

    I have tried changing this in MIGX but no items appear in the cmp & they also do not appear in the Mysql table.

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

      • 4172
      • 5,888 Posts
      I really would recommend using 'id' as the primary-field.

      what is your form-processing-code?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 47630
        • 56 Posts
        Hi Bruno,

        It is CoffeeCup FormBuilder.
        I've been searching for every instance of _rowid_ in the output php files from coffeecup formbuilder but when I change the value to id the form fails to record the info in Mysql db. (the error log says 'unknown column submitted in field list').

        I've been asking on the CoffeCup forums how to do this but I could not get an answer.

        So I am looking to do it the other way around in MIGX by trying to change the id to _rowid_ to match the forms incremental field id.

        I have tried using _rowid_ in MIGX but the information does not show in the CMP or in MySql.

        I really would recommend using 'id' as the primary-field.

        You say recommend, not that it cannot be done.
        So I guess the next question would be if it can be done how would I do it?
          • 4172
          • 5,888 Posts
          I think, it should be possible to change the id-field to _rowid_
          but I would need to invest some time and try it by myself.
          This would need to create some custom-processors and may be some special settings are needed.
          It would need some time for me to figure that out.

          I think it should be simpler to change the form-processing-code or rebuild it with a formit-hook-snippet.

          Can't you post that code, which stores the data to the db here and the html of your form?
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
          • discuss.answer
            • 47630
            • 56 Posts
            Hi Bruno,

            Actually I persevered with changing the CoffeeCup output php files & I got them to synch together.

            I can now use the CoffeeCup FormBuilder with MIGX & I gotta say I am very happy because this is the best form I ever worked with smiley

            Just in case anyone wants to know how, these are the steps I took (in CoffeeCup FormBuilder):

            I changed every variation of 'rowid' to 'id' in these php files:

            dataaccessreporter.cls
            datasave.cls
            datasavemysq.clsl
            formpage.cls

            (i ignored the sqllite php files)

            I basically just opened every php file in Notepad++ & did a search for 'rowid', as they were found I changed them.
            Next open the following file:

            formpage.cls

            Remove the following from line 109:

            $this->post[ '_submitted_' ] = date('Y-m-d H:i:s');

            (the above line was causing this error):

            Unknown column '_submitted_' in 'field list'




            After reading your post I'm glad I got it working because i'm imagining it would be challenging & time consuming to do this in MIGX.