| | |
Sort Problem
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Aug 2007
Posts: 199
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:
PHP Syntax (Toggle Plain Text)
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
•
•
Join Date: Aug 2007
Posts: 199
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 8:38 pm.
•
•
Join Date: Aug 2007
Posts: 199
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 9:06 pm.
![]() |
Similar Threads
- 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
| Thread Tools | Search this Thread |
.htaccess ajax apache api array back basic beginner binary broken cakephp checkbox class cms code computing cron curl customizableitems database date delete display dynamic echo email error file files filter folder form forms function functions gc_maxlifetime google host href htaccess html image include insert integration ip java javascript joomla limit link login loop mail memmory memory menu mlm mod_rewrite multiple mysql navigation oop parsing paypal pdf php problem query radio random recursion regex remote script search server sessions sms snippet soap source space sql syntax system table thesishelp trouble tutorial update upload url validation validator variable video web xml youtube





