Jump to content


Duplicate entry '0' for key 1

  • Please log in to reply
2 replies to this topic

#1 essenz

  • Members
  • Pip
  • Newbie
  • 4 posts
  • LocationNew Zealand

Posted 03 December 2003 - 10:14 AM

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.



#2 triphis

  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 04 December 2003 - 02:13 AM

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
Xac Attack

#3 essenz

  • Members
  • Pip
  • Newbie
  • 4 posts
  • LocationNew Zealand

Posted 04 December 2003 - 07:55 AM

Apperantly the ipb_members table ID column isn\'t Auto_increment, so I hall change this and see what happens.

Thanks for the tip.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users