| | |
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 |
# 5.2.10 alexa apache api array beginner binary broken cakephp checkbox class clean clients cms code cron curl database date directory display dissertation dynamic echo echo$_get[x]changingitintovariable... email encode error fairness file files folder form forms function functions google href htaccess html image images include indentedsubcategory insert ip javascript joomla legislation limit link local login mail memberships menu mlm multiple multipletables mysql mysqlquery newsletters oop open paypal pdf persist php problem provider query radio random recursion remote rss script search server sessions sms sockets source space spam sql syntax system table tutorial update upload url validator variable variables video web youtube





