| | |
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 |
advanced apache api array beginner binary broken cakephp check checkbox class cms code cookies cron curl database date datepart display dropdownlist dynamic echo email eregi error execution file files folder form forms function functions google head href htaccess html if...loop image include includingmysecondfileinthechain insert ip javascript job joomla jquery key library limit link login mail menu mlm multiple mysql oop password paypal pdf pdfdownload php phpvotingscript problem query radio random recursion remote screen script search server sessions smarty sms sorting source space sql startup stored syntax system table traffic tutorial unicode update upload url validator variable video web youtube zend





