Niv_H
Niv_H

Reputation: 61

How can i sort hebrew in Mysql?

Im trying to sort hebrew in sql and print it in php..
I tried to do:

$query_skey002 = "SELECT * FROM `s_keywords` ORDER BY `name2` ASC";

Dont work..
I tried to use php sort function but i dont know how to sort sql array in this function
Thanks for the helpers..

Upvotes: 4

Views: 924

Answers (4)

Obmerk Kronen
Obmerk Kronen

Reputation: 15949

Strangely enough ( or not so strange if you know that Zend is an IL company) , a simple

sort($query_skey002);

in PHPshould do for HE...

Upvotes: 0

Niv_H
Niv_H

Reputation: 61

I solved it..
i just changed the query to

$query_skey002 = "SELECT * FROM `s_keywords` ORDER BY BINARY `name2` ASC";

Thanks for everybody !..

Upvotes: 0

user2373802
user2373802

Reputation:

If i'm not mistaken and you mean how to sort based on alphabetical order, then you need to use a proper COLLATION fro your table. probably utf8-general does the job

Upvotes: 0

Vivek Sadh
Vivek Sadh

Reputation: 4268

MySQL can sort hebrew text if you use the correct charset/collation.

http://dev.mysql.com/doc/refman/5.0/en/charset-mysql.html

Upvotes: 2

Related Questions