Advice needed for saving to 2 databases, 1 local, 1 remote

groovezog 12 Apr, 2014
I would like to save form data to 2 different database tables, one local and the other remote. It seems that the "DB Save" action only works once per submission, in other words I cannot simply create two separate actions in my form events.

I would like some feedback on how I should go about this.

I thought about a custom action or cURLing the data, but then I thought I should post here first in case it is something as simple as changing a line of code or adding an event loop or something.

I would appreciate any advice or help that can be offered. Thanks.
Max_admin 12 Apr, 2014
Hi groovezog,

You can simply use 2 consecutive "db save" actions, you must use the advanced wizard though!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 12 Apr, 2014
Hi groovezog,

The DB Save action should work more than once but you will have to take care of the input names to make sure that you are saving the data into the correct table. What makes you think that isn't working?

Bob
groovezog 12 Apr, 2014
Thanks for the quick responses, guys.

- I've created the two DB Save events. One right after the other.
- I am using the Advanced Wizard.
- Each one of them works separately (when I disable the local one; when I set "Save to Different Database" to "no" on the remote one; OR when I remove one of them).
- When they are both enabled, the form will send the same record twice to the database in the action that is listed first. Nothing is sent to the database in the second action.

I think I have all the settings correct because, like I wrote, each action works when it's by itself. However, if you two both know it works, maybe I am simply overlooking something.
GreyHead 13 Apr, 2014
Hi groovezog,

That sounds like there may be a little bug in the DB Save action that doesn't allow the DB object to be redefined for the second save :-(

Bob
Max_admin 13 Apr, 2014
Answer
Do your tables have the same name ?

Could you please try to set different model id for each one ?

If that doesn't work then please try to enable the "save under model id" setting and make sure that your data is posted under that model id to be saved correctly.
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
groovezog 25 Apr, 2014
UPDATE:
@Max - Yes, the tables had the same name. I wasn't thinking of this, but it should have been obvious. Changing the name of the second table fixed the problem.

Thank you very much for your help. I appreciate it.
This topic is locked and no more replies can be posted.