On Wed, Jul 11, 2012 at 2:39 PM, mohit kumar <[email protected]> wrote:
> Hi Folks,
>
> I created an add action for users,
> I am trying to register them using this action. Everything is going fine,
> the data is being submitted, the passwords are being hash and if I check the
> registration is happening. But I am getting the following error.
>
>> Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'

There shouldn't be an id of 0 if its auto incrementing. Did you set an
auto_increment_offset anywhere?
What is your add action? Post the code here so we can see if the id is
being set anywhere.

What happens if you run:
SELECT id,username FROM users WHERE id=0;

Mike.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to