How does one sort the query results in the alphabetic order of the first character?
If the database uses the GBK character set
$ SQL = 'select brand_id, brand_name FROM '. $ GLOBALS ['ecs']-> table ('brand'). 'order BY brand_name ';
If the database uses the UTF8 Character Set
$ SQL = 'select brand_id, brand_name FROM '. $ GLOBALS ['ecs']-> table ('brand '). 'order by convert (TRIM (brand_name) USING gbk )';
Articles you may be interested in
- Sort two-dimensional arrays by specified key values
- Navicat for mysql remote connection to the mySql database prompt 10061,1045 error Solution
- Php obtains all the files in the directory and saves the results to the array program.
- Note the following when querying strings with single quotes and inserting strings with single quotes in Mysql:
- Improves the query speed of millions of data records for MySQL
- Summarize the causes and solutions for the slow MySQL Database Server
- Rational use of MySQL database indexes to make the database run efficiently
- Prohibit web page right-click, copy, save as, View Source file and other functions to implement web page source code protection