Jump to content
  • 0

[SQL]: DB error - Duplicate entry '1' for key 'PRIMARY'


pajodex

Question


  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  436
  • Reputation:   167
  • Joined:  12/12/17
  • Last Seen:  

[SQL]: DB error - Duplicate entry '1' for key 'PRIMARY'
[Debug]: at h:\dxro\rathena\src\map\script.cpp:16633 - INSERT `zzz_game` VALUES(1,2000001,150003)
[Debug]: Source (NPC): Kill Me at arena_room (97,100)
[SQL]: DB error - Duplicate entry '1' for key 'PRIMARY'
[Debug]: at h:\dxro\rathena\src\map\script.cpp:16633 - UPDATE `zzz_game` SET `id` = 1 WHERE `account_id` = 2000001 AND `char_id` = 150003
[Debug]: Source (NPC): Kill Me at arena_room (97,100)
[Error]: buildin_sleep2: no unit is attached
[Debug]: Source (NPC): Kill Me at arena_room (97,100)
[SQL]: DB error - Duplicate entry '1' for key 'PRIMARY'

Hi,

Im getting this error. I dunno what to do. Please help

This is from an old script that I ordered long ago, I'm trying to revive it as much as I can.

Edited by pajodex
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  04/15/16
  • Last Seen:  

Hello, 

[SQL]: DB error - Duplicate entry '1' for key 'PRIMARY'.// Can help you --> Here
[Error]: buildin_sleep2: no unit is attached.// And something like --> This
Edited by Hidekitakase
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  78
  • Topics Per Day:  0.03
  • Content Count:  436
  • Reputation:   167
  • Joined:  12/12/17
  • Last Seen:  

CREATE TABLE IF NOT EXISTS `zzz_game` (
  `id` int(11) NOT NULL auto_increment,
  `account_id` int(11) NOT NULL default '0',
  `char_id` int(11) NOT NULL default '0',
  PRIMARY KEY  (`account_id`)
) ENGINE=MyISAM;

Already did that. Or didn't I?

Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3122
  • Reputation:   1615
  • Joined:  03/26/12
  • Last Seen:  

The script is trying to insert the value "1" in a column labelled as a primary key, so you can't re-insert nor update that value. You script need fixing.

Link to comment
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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...