solving error ”duplicate entry 0 for the key primary”

I faced this problem while tried to post data in the database.
It occurred because the Table had the Primary key as ID which was ”Default 0” and not even ”auto incremented”… for testing purpose in localhost, I just made it auto-increment and ”default” to ”none”.

But this is not always a solution for a database may be. the following links might help if it occurs again.

link 1
link 2

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s