Jump to content

Duplicate entry '0' for key 1


essenz

Recommended Posts

I\'ve got a members area and a forum, now I figured that I should be able to use one table to handle the user info and login process.

 

So I installed the forum and then wrote a php script for the new users to register and I want it to insert the info into the forum members table.

 

But I can\'t seem to get around this:

 

Duplicate entry \'0\' for key 1

 

Any suggestions?

 

I\'m using ipb forum.

 

Thanks

 

Essenz

Link to comment
Share on other sites

Most likely the id or name column is set to \"unique\" or something. The id is also probably set to auto_increment. I don\'t know if you understand PHP or not, so either:

 

Make sure the form process page that puts the info into the tables in like:

 

INSERT INTO table (id,name,email,whatever) VALUES (\'\',\'$name\',\'$email\',\'$whatever\');

 

Notice the value for ID is blank, because the database auto matically does that for you...

 

OR if you don\'t know PHP...

 

Delete the \"unique\" and other kets from the table, uning PHPMY Admin :P lol, not the best solution, but I do not know what else to suggest

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.