How can I sort non-English strings in MySQL?
CREATE TABLE IF NOT EXISTS `gujarati` (
`name` varchar(20) CHARACTER S开发者_运维百科ET utf8 COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `gujarati` (`name`) VALUES
('ક'),
('દિનેશ'),
('ખા'),
('ગા'),
('થા'),
('થ'),
('કા'),
('મયૂર'),
('છત્ર'),
('ત્ર'),
('ક્ષ'),
('તા'),
('એક'),
('બોલ્ડ'),
('જ'),
('ટી'),
('મી'),
('હા'),
('યા'),
('ના'),
('ધી'),
('સો'),
('લા'),
('ઝા'),
('ણ્ણા');
This is my table that stores the Gujarati language. How can I sort this data in a MySQL database?
Set the gujarati
's table collation to the one coresponding to this language, then simply sort with ORDER BY
- it's supposed to work out of the box
Please use this meta tag :
meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
And use this code in php :
mysql_query ("set character_set_results='utf8'");
精彩评论