On Thu, Jun 11, 2009 at 11:27 AM, PJ<af.gour...@videotron.ca> wrote:
> Robin Vickery wrote:
>> 2009/6/11 PJ <af.gour...@videotron.ca <mailto:af.gour...@videotron.ca>>
>>     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
> Nice thought, Robin. My collation is already uft8_general_ci.
> Adding that condition to the query changes nothing; and specifying
> another collation return a blank or null and the list is not echoed.
> Even changing the collation in the db does not change anything. Same
> wrong results.
> Thanks anyway.
> --
> Hervé Kempf: "Pour sauver la plančte, sortez du capitalisme."
> -------------------------------------------------------------
> Phil Jourdan --- p...@ptahhotep.com
>   http://www.ptahhotep.com
>   http://www.chiccantine.com/andypantry.php

Are you storing the actual characters in the database or are you
storing the HTML entities? It WON'T sort correctly if you are storing
the entities.

Make sure you are storing the actual characters in your database, and
then make sure that you are sending the correct content-type header
when you serve the page. If you try to serve UTF-8 characters but your
server is sending a Content-Type: ISO-8859-1; header, you will get
placeholders in FF for characters that aren't recognized.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to