MariaDB/MySQL : Form select statement or search query with Chinese characters




Continue from the previous tutorial on how to handle non-ASCII characters in URL. Just a note on how to form select statement or search query with Chinese characters as search parameter. Putting this note down for future reference. Maybe useful to you as well.

 SELECT * FROM table where title like '%白文春%'

or increase the search scope

 SELECT * FROM table where title like '%白%春%'

For accuracy, just use equal sign.

 SELECT * FROM table where title = '白文春'

Reference :

https://www.socketloop.com/tutorials/php-how-to-handle-uri-or-url-with-non-ascii-characters-such-as-chinese-japanese-korean-cjk





By Adam Ng

IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.


Advertisement