Sometimes when we read the database output, we may need to sort according to the Chinese user name. The traditional MySQL query code is as follows:
Copy code The code is as follows:
$sql="SELECT * FROM users";//Traditional query method
The MySQL query code for sorting by Chinese user names is as follows:
Copy code The code is as follows:
$sql="SELECT * FROM users ORDER BY CONVERT(name USING gbk)";//Use according to Chinese
http://www.bkjia.com/PHPjc/326512.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/326512.htmlTechArticleSometimes when we read the database output, we may need to sort it according to the Chinese user name. Traditional MySQL The query code is as follows: The copy code is as follows: $sql="SELECT...