Showing entries 11 to 12
« 10 Newer Entries
Displaying posts with tag: collation (reset)
Unicode coming to PHP 6

The move from PHP 5 to PHP 6 will be a painful one. But once it’s done, I hope that it will be easier to handle safe web development for a global, multi-language internet. After all these years, we still … Continue reading →

MySQL: Collation matters when using unique indexes

When using a uniqie index on a text field in mysql, the column collation setting is very important. The collation settings of a column does not only affect sorting and comparsion, but also unique indexes. So you can not insert "a" and "A" into a table that has a unique index on a column that has a case-insensitive collation. The mysql manual about collations: "A character set is a set of symbols and encodings. A collation is a set of rules for comparing characters in a character set."

Here is an example:
The column text in table text1 has a case-sensitive collation (_cs suffix), the column in text2 has a case-insensitive collation (_ci suffix).

PLAIN TEXT CODE:

  1.  
  2. CREATE TABLE text1 (
  3.   `text` varchar(50) character set latin1 collate latin1_general_cs NOT NULL …
[Read more]
Showing entries 11 to 12
« 10 Newer Entries