0

Weird issue:

ERROR 1062: 1062: Duplicate entry '21474836476' for key 'twitterid'
SQL Statement:
INSERT INTO `database`.`wp_table` (`id`, `twitterid`) VALUES ('34', '33456305746')

Even though I typed in 33456305746, it thinks I am typing in 21474836476. Now this row does exist already so I tried deleting it and it saves the row with a value of 21474836476. If I remove the unique requirement it saves both rows as 21474836476. Anyone know what in the world is going on here?

stevo81989
  • 170
  • 1
  • 9

1 Answers1

4

21474836476 is (close to) the max value of an integer which is the data type of your field.

33456305746 is bigger and the DB truncates the value to the max integer which you already inserted at some time before.

Change the data type of the field to bigint if you need such high numbers.

juergen d
  • 201,996
  • 37
  • 293
  • 362