# And MySQL: SQL correct sort with diacritics

**URL:** https://forum.kirupa.com/t/and-mysql-sql-correct-sort-with-diacritics/264670
**Category:** Uncategorized
**Created:** [June 28, 2008, 11:50am UTC](https://forum.kirupa.com/t/and-mysql-sql-correct-sort-with-diacritics/264670 "2008-06-28T11:50:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![X\_plorer](https://avatars.discourse-cdn.com/v4/letter/x/b487fb/32.png) [@X\_plorer](https://forum.kirupa.com/u/X_plorer)
#### Post date: [June 28, 2008, 11:50am UTC](https://forum.kirupa.com/t/and-mysql-sql-correct-sort-with-diacritics/264670/1 "2008-06-28T11:50:43Z")

</div>

I’m using MySQL 5.0.15 under Win XP SP2 and PHP 4.4.8 along with Apache 2. I created MySQL database like utf-8 and made one table inside it. After that I made 15-20 rows in order to populate table. When I made PHP-script that read records from mentioned table they appeared with wrong ordered national (diacritics) characters that is normal for Windows CEE (CP 1250). Query was very simple:

```php
Select * from addresse order by a_lastname

```

National charcters are appearing OK, there is no ? or so weird characters, jut sorting isn’t OK. Is there some way where I could make some routine that would proper sort sql-results before it appear on page, or it has already inside PHP?  
Thanks in advance.👼
