Incorrect sorting with “order by”

The post is also available in: Swedish

Got some problems with sorting in wordpress again, posting a short solution.

Does the response return rows in incorrect order, in the sense that letters like Å and Ä are counted as A and Ö counts as O, even though you specified an “order by” statement? The fault probably lies in the table’s collation.

Try the following SQL code:

ALTER TABLE wp_posts
COLLATE utf8_swedish_ci

Remember to always back up your database before you paste any code from unknown sociopaths on the internet. That is, if you do not feel secure in what the code does and how you can restore it if something goes wrong.