Collation problem when used with "SET NAMES"
Posted by: Tore Krudtaa
Date: July 28, 2006 08:14AM

Hi.

Using PHP and MySQL 5.1.9-beta

If I use:

mysql_query("SET NAMES 'utf8'");

$query = "select sql_cache f1, f2, f3
from page
order by f2, f3 collate utf8_danish_ci";

Where field f3 contains a string.

Then the text is sorted correctly.

If I use:

mysql_query("SET NAMES 'utf8' collate 'utf8_danish_ci' ");

$query = "select sql_cache f1, f2, f3
from page
order by f2, f3";

Where field f3 still contains a string.
Then the sorting on the f3 field is not correct.

I thought using the collate parameter with the SET NAMES made it possible to do the queries without specifying the collation.

Anyone with an explanation?



Edited 1 time(s). Last edit at 07/28/2006 08:14AM by Tore Krudtaa.

Options: ReplyQuote


Subject
Views
Written By
Posted
Collation problem when used with "SET NAMES"
2487
July 28, 2006 08:14AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.