How can I sort Hebrew in mysql?

I am trying to sort Hebrew in sql and print it in php ..
I have tried:

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

Does not work.
I tried to use php sort function, but I don't know how to sort sql array in this function
Thanks for the helpers.

+4
source share
4 answers

MySQL can sort hebrew text if you use the correct encoding / matching.

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

+2
source

If I'm not mistaken, and you mean how to sort in alphabetical order, then you need to use the proper COLLECTION for your table. perhaps utf8-general does the job

0
source

I solved it.
I just changed the request to

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

Thanks to everyone! ..

0
source

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

sort($query_skey002);

in PHP should do for HE ...

0
source

Source: https://habr.com/ru/post/1492479/


All Articles