Forums

1062 - Duplicate entry

alex305v 25 Feb, 2016
I am not sure why or how but a form of mine wont wont save and gives me a 1062 - Duplicate entry. It was working at some point then it just failed. I did what said on the FAQs with the cf_id but thats not doing it for me. I have other forms saving to the same table and they all work fine but one. I created a new forms from scratch, added a texbox named cf_id, changed the row id to cf_id on the table and nothing is working. Has anyone experienced this?
GreyHead 25 Feb, 2016
Hi alex305v,

Please drag a Debugger action into the On Submit event, then submit the form and copy and paste the debug results here.

Hmmm - that might not work in Joomla! 3 - do you see the MySQL query on the error message page?

Bob
alex305v 27 Feb, 2016
Debugger does not work.

1062 - Duplicate entry '139' for key 'PRIMARY' SQL=INSERT INTO `kkdnh_chronoengine_NotateMember` (`stuname`, `stuusername`, `stuemail`, `name`, `message`, `id`, `user_id`, `uniq_id`, `created`) values ('Alex Caballero', '1016661', 'alex.caballero@vatstar.com', 'Alex Caballero', 'Certified P1', '139', '411', '21374293b7557215e78ca5e1298cb4e74510bed5', '2016-02-26 22:19:32');
GreyHead 27 Feb, 2016
Hi alex305v@gmail.com,

It's saying that there is already a record with id = 139 so you can't do an insert. Where is the value of id coming from here? Do you have Force Save set to Yes in the DB Save action?

Bob
alex305v 27 Feb, 2016
I do. The form is saving to two different database, the second one has the Force Save set to Yes. In addition to the two database the form also updates a third database thru CCv5.
GreyHead 27 Feb, 2016
Hi alex305v,

So where is the value of id coming from?

Bob
alex305v 27 Feb, 2016
the value is randomly set by the form. You know how every row on a database has an ID, that's it, the problem is the ID on this form is down on the 100s where the database is on the 600s (on the ID).
GreyHead 27 Feb, 2016
Hi alex305v,

If you randomly set an id and it is the primary key column for your table then I doubt that it is ever going to work?

What are you trying to do?

Bob
alex305v 27 Feb, 2016
Oh, no, I don't set it myself the form does it. It's automatically and should go up 1 every new form but when the last form submitted is at an ID of 600s this form is stuck on the 100s.
GreyHead 28 Feb, 2016
Hi alex305v,

How exactly does the form set it?

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