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
+26k Golang : Convert integer to binary, octal, hexadecimal and back to integer
+5k Golang : Extract unicode string from another unicode string example
+17.1k Golang : Logging with logrus
+24.2k Golang : How to read integer value from standard input ?
+3.5k Golang : Valued expressions and functions example
+9.1k Android Studio : Checkbox for user to select options example
+5.6k Golang : Skip or discard items of non-interest when iterating example
+7.1k Golang : Variadic function arguments sanity check example
+14.1k Golang : How to login and logout with JWT example
+8.6k Golang : How to check if a website is served via HTTPS
+13.2k Golang : How to shuffle elements in array or slice?
+12.1k Golang : Read from buffered reader until specific number of bytes