Sort Problem
Please support our PHP advertiser: Free Online Load Test - How many visitors can your web site handle?
Thread Solved
![]() |
•
•
Posts: 192
Reputation:
Solved Threads: 0
Hello everybody,
I am using WAMP:
1. PHP 5..
2. MySQL 5..
3. Apache 2..
the collation of my database and tables and fields are 'utf8_persian_ci', and also my query is in this format in PHP:
this all utf8 is for my Arabic and persian words...
Problem:
I faced a problem on sorting english words, I dont know why the result on the browser is like the attachment
I am using WAMP:
1. PHP 5..
2. MySQL 5..
3. Apache 2..
the collation of my database and tables and fields are 'utf8_persian_ci', and also my query is in this format in PHP:
mysql_query("SET NAMES utf8");
mysql_query("SET CHARACTER SET utf8");
$query = mysql_query("SELECT * FROM tblName SORT BY fieldName COLLATE utf8_persian_ci");this all utf8 is for my Arabic and persian words...
Problem:
I faced a problem on sorting english words, I dont know why the result on the browser is like the attachment
•
•
Posts: 192
Reputation:
Solved Threads: 0
I dont have farsi sort problem, but see the attachment, the problem is that the english words are not sorted correctly ...
also I enter through the web, mysql command line, phpMyAdmin the following data:
Asad
asad
Asad
asad
and again by executing the following query I get the same dispaly:
SELECT * FROM tblName order by fieldName;
or
SELECT * FROM tblName order by fieldName COLLATE utf8_persian_ci;
The Result:
Asad
asad
Asad
asad
also I enter through the web, mysql command line, phpMyAdmin the following data:
Asad
asad
Asad
asad
and again by executing the following query I get the same dispaly:
SELECT * FROM tblName order by fieldName;
or
SELECT * FROM tblName order by fieldName COLLATE utf8_persian_ci;
The Result:
Asad
asad
Asad
asad
Last edited by tanha : May 17th, 2008 at 7:38 pm.
•
•
Posts: 192
Reputation:
Solved Threads: 0
Then if I try to use the binary, then it is ok, but you know that the binary sort according to ascii code of the character, then the following problem:
Asad
asad
Asad
asad
Bob
Tom
the output:
Asad
Asad
Bob
Tom
asad
asad
The sort must be like this:
Asad
Asad
asad
asad
Bob
Tom
Asad
asad
Asad
asad
Bob
Tom
the output:
Asad
Asad
Bob
Tom
asad
asad
The sort must be like this:
Asad
Asad
asad
asad
Bob
Tom
Last edited by tanha : May 17th, 2008 at 8:06 pm.
![]() |
Similar Threads
Other Threads in the PHP Forum
- Problem while installing linux (*nix Software)
- Can a power problem affect my hard drive? (Cases, Fans and Power Supplies)
- Insertion Sort Problem (C++)
- NIC Problem (PCI and Add-In Cards)
- RAM problem (Motherboards, CPUs and RAM)
- Desktop background hijacked-NEW Problem (Web Browsers)
- Desktop Background Hijacked-NEW Problem(! Smart Security) (Viruses, Spyware and other Nasties)
Other Threads in the PHP Forum
- Previous Thread: Can i load my page before displaying it ??
- Next Thread: php form submitting empty variables
•
•
•
•
Views: 987 | Replies: 10 | Currently Viewing: 1 (0 members and 1 guests)





Linear Mode