UTF-8 中的中文不是按照拼音排序的,因此对于 使用 UTF-8 编码集的字段就无法按照拼音进行排序,最简单的解决方法就是转成 GBK 编码。
实例代码:
数据库表结构:
测试环境:Windows 2003 Standard Edition,MySQL 5.1.22-rc-community。
对于偶正在使用的 Symfony 框架,因为使用了 propel 做 ORM,比较难直接操作SQL,除非使用 RAW SQL,而且使用 RAW SQL会导致很多高级特性无法使用,解决方式:
© 2007 nullTao - 净空无道 - Blog | Main site | Contact me | RSS | Back to top
Powered by Serendipity | Design by Andreas Viklund | Serendipity Template by Carl