DB Save results in page errors

Resolve DB Save causing page errors and duplicate record conflicts.

Overview

The issue occurs when a form's DB Save action triggers a duplicate entry error, often due to an existing ID value in the form data conflicting with the database table.
Clear the ID value before DB Save using the provided FAQ guidance, and ensure the database table is properly structured by recreating it within CF to allow multiple submissions.

Answered
jm jmeidal 04 Jan, 2017
Since yesterday I have had a form (just this single form, other forms are working fine) result in a page not found error 1062 or 23000 when DB Save is added to my submit area. When I disable it, the form submits, when I enable it the page will not load.

This just began happening yesterday, perhaps after the 5.0.14 update. I do have a nocaptcha loaded and checked, but I've rebuilt this entire form twice now, and it seems to be the DB Save. It is in the same site database, not an external one.

Within submit, I also have an email element, and that does work, but the message and page does not load, it rather goes to a site error page. All the DB Save options are default, I've only chosen the table name.

Thanks for any help.
Gr GreyHead 04 Jan, 2017
Hi jmeidal,

The Error code suggests that there is a Duplicate record being found. This can happen if you have a value for ID set in the form data - perhaps from an article ID. If that is happening then you need to unset the ID value before the DB Save.

Bob
jm jmeidal 04 Jan, 2017
Yes, I do see there is a DB record conflict. If I remove the data from the DB table the form will save the data one time, before the error reoccurs.

But how do I clear the ID permanently? I assume in the Update Conditions field or custom code?
jm jmeidal 05 Jan, 2017
1 Likes
Thanks for that link. I did test the unset of "id" which still did not seem to work.

It was solved when I removed the table I had made in MySQL and created it automatically within ChronoForms. Multiple entries now submit and save fine.
This topic is locked and no more replies can be posted.