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
  • 8,843
  • 26
  • 98
  • 202

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,511
  • 2
  • 29
  • 45
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,783
  • 4
  • 25
  • 48