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
+20.7k Golang : Read directory content with os.Open
+10k Golang : Check if user agent is a robot or crawler example
+18.4k Golang : How to get hour, minute, second from time?
+6.9k Golang : Decode XML data from RSS feed
+6.6k Golang : Convert an executable file into []byte example
+10k Golang : Read file and convert content to string
+8.8k Golang : Get final balance from bit coin address example
+19.4k Golang : How to count the number of repeated characters in a string?
+16.1k Golang : Generate universally unique identifier(UUID) example
+13.7k Golang : Qt progress dialog example
+9.6k Golang : Validate IPv6 example
+21.8k Golang : Upload big file (larger than 100MB) to AWS S3 with multipart upload