1

In mysql with "latin1_swedish_ci" collation these records:

   INSERT INTO test VALUES ('è');
   INSERT INTO test VALUES ('e');

are the same... If this varchar colum is a primary index and I try to inser these values I get a duplicate primary key error. Is it possibile to change this behaviour?

thanks

Tobia
  • 9,165
  • 28
  • 114
  • 219

2 Answers2

0

Which version of MySQL are you using? It could be a unicode problem

MySQL VARCHAR Lengths and UTF-8

Community
  • 1
  • 1
KeepCalmAndCarryOn
  • 8,817
  • 2
  • 32
  • 47
0

you can insert ascii code to db as the following

INSERT INTO test VALUES ('232');
INSERT INTO test VALUES ('101');

Then you can read them and in php use chr function to get character.

Ayman Hussein
  • 3,817
  • 7
  • 28
  • 48