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 :
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
Tutorials
+21.8k Golang : GORM create record or insert new record into database example
+6.7k Grep : How to grep for strings inside binary data
+7.2k Restart Apache or Nginx web server without password prompt
+4.5k Golang : Valued expressions and functions example
+38.5k Golang : Converting a negative number to positive number
+5.2k Linux : How to set root password in Linux Mint
+5.3k Golang : Issue HTTP commands to server and port example
+18.3k Golang : Get command line arguments
+14.5k Golang : Simple word wrap or line breaking example
+17.3k Golang : Capture stdout of a child process and act according to the result
+5.4k Golang : Convert lines of string into list for delete and insert operation
+20.7k nginx: [emerg] unknown directive "passenger_enabled"