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
+8.5k PHP : How to parse ElasticSearch JSON ?
+9.5k Golang : Detect Pascal, Kebab, Screaming Snake and Camel cases
+10k Golang : Check if user agent is a robot or crawler example
+13.8k Golang : Image to ASCII art example
+6.6k PHP : Shuffle to display different content or advertisement
+5.4k Golang : How to deal with configuration data?
+17.3k Golang : Find file size(disk usage) with filepath.Walk
+7.4k Golang : File system scanning
+10.7k Golang : Resolve domain name to IP4 and IP6 addresses.
+12.2k Golang : Sort and reverse sort a slice of runes
+9.2k Golang : Gonum standard normal random numbers example