This topic is locked

<<< Record was NOT added >>>

11/23/2008 4:20:25 PM
PHPRunner General questions
unitedintruth author

First entry works flawlessly, when trying to add a second entry into the database I am getting the following error:
<<< Record was NOT added >>>
Duplicate entry '0' for key 1
I have searched the forum and have checked all the repair suggestions with no luck, anybody got any ideas?
Thanks,

Craig

S
swanside 11/24/2008

Sounds like its a MySQL database problem. Make sure you have a primary key in your database.

Pfeiffer 11/24/2008

Hello,

I always got this error when I had a primary key but I forgot to define in MYSQL that this key is

autoincrement !!! If you forget this, mysql will put 0 to promary key the first record.

Then when you add a second record mysql will again put 0 to primary key but this will cause your

error message
Hope this helps.
Best regards

Uwe Pfeiffer

unitedintruth author 11/24/2008

I thank you guys very much, that was the problem. All works perfect now.
Thanks,

Craig