Re: order by what?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/6/11 PJ <af.gourmet@xxxxxxxxxxxx>

> How can order by be forced to order alphabetically and ignore accents
> without stripping the accents for printout? This is a problem for both
> caps & normal letters.


Depends on the database.

If you're using mysql, the order is governed by the collation used. To get
the order you want, you need a case-insensitive and accent-insensitive
collation. Exactly which one you use will depend on the character set that
you're using, but if you're character set is utf8, then the utf8_general_ci
collation should work:

SELECT fieldname FROM tablename ORDER BY fieldname COLLATE utf8_general_ci;

-robin

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux