One form save two database

alex305v 23 Jul, 2015
I have one form that needs to save in two different databases. The problem is that is only saving to one of the two (the one on top). Any idea how to fix this?
GreyHead 23 Jul, 2015
Hi alex305v,

There may be a problem with record ids. Please drag a Debugger action into the On Submit event, then submit the form and post the debug results here.

Bob
alex305v 23 Jul, 2015
Array
(
    [9] => Array
        (
            [TCPDF] => Array
                (
                    [0] => /hermes/walnaweb01a/b1102/pow.myreefnet2/htdocs/VATSTAR/components/com_chronoforms5/chronoforms/pdfs/content-edit/content-edit_20150723130207.pdf has been saved correctly.
                )

        )

    [6] => Array
        (
            [Email] => Array
                (
                    [0] => An email with the details below was sent successfully:
                    [1] => To:rob.shearman@vatstar.com, cfi@vatstar.com, records@vatstar.com, alex.caballero@vatstar.com
                    [2] => Subject:Certification
                    [3] => From name:VATSTAR
                    [4] => From email:donotreply@vatstar.com
                    [5] => CC:
                    [6] => BCC:
                    [7] => Reply name:VATSTAR
                    [8] => Reply email:cfi@vatstar.com
                    [9] => Attachments:
                    [10] => Array
                        (
                            [0] => /hermes/walnaweb01a/b1102/pow.myreefnet2/htdocs/VATSTAR/components/com_chronoforms5/chronoforms/pdfs/content-edit/content-edit_20150723130207.pdf
                        )

                    [11] => Body:
<p><span style="font-family: Calibri; font-size: medium;"><span style="font-family: Verdana; font-size: small;">Rob Shearman Jr - 1155655</span></span></p>
<p style="margin: 0in 0in 8pt;"><span style="font-family: Calibri; font-size: medium;">We want to congratulate you for your accomplishment in VATSTAR. After a close review, our instructors and CFI agreed to certify you with the <span style="font-family: Verdana; font-size: small;">P1-P2</span> Certification. Give it 24 hours to fully show on VATSIM and VATSTAR database. </span></p>
<p><span style="font-family: Times New Roman; font-size: medium;"> <br /></span></p>
<p style="margin: 0in 0in 8pt;"><span style="font-family: Calibri; font-size: medium;">Attached is your official Certification approved by VATSTAR ATO.</span></p>
<p><span style="font-family: Times New Roman; font-size: medium;"> <br /></span></p>
<p style="margin: 0in 0in 8pt;"><span style="font-family: Calibri; font-size: medium;">Keep flying<br /> VATSTAR Staff Team</span></p>
<p> </p>
                )

        )

    [8] => Array
        (
            [DB Save] => Array
                (
                    [Queries] => Array
                        (
                            [0] => INSERT INTO `kkdnh_chronoengine_stats` (`stuusername`, `name`, `P1`, `P2`, `user_id`, `uniq_id`, `created`) values ('1155655', 'Alex Caballero', '1', '1', '411', '81a104b0b33563562476cc0c4b0dd3f3fb4ff322', '2015-07-23 13:02:07');
                        )

                )

        )

    [7] => Array
        (
            [DB Save] => Array
                (
                    [Queries] => Array
                        (
                            [0] => UPDATE `kkdnh_chronoengine_stats` AS `Data` SET `stuusername` = '1155655', `name` = 'Alex Caballero', `P1` = '1', `P2` = '1', `user_id` = '411', `modified` = '2015-07-23 13:02:07' WHERE `id` = '23';
                        )

                )

        )

)
GreyHead 24 Jul, 2015
Hi alex305v,

As you can see the second database query is updating an a record (presumably the newly created one) in the same table.

I suggest that you check the table setting for the second DB Save - you might also need to unset the id value so that it creates a new record.

Bob
alex305v 02 Aug, 2015
There are three actions taken here, 2 save new 1 update. For the Update i am using "Connection Action". You are saying the second saving action i need to unset the id value so it creates a new record. What do you mean by that? Change the Model ID, Multi Save, Save under Model ID?

Thanks
alex305v 02 Aug, 2015
Fixed, i looked over the settings like you said and it fixed it. thanks
GreyHead 02 Aug, 2015
Hi alex305v,

Sorry I didn't give more info about the id. For other readers - please see this FAQ

Bob
This topic is locked and no more replies can be posted.