MySQL: Querying for unicode entities

前端 未结 3 1587
刺人心
刺人心 2020-12-03 22:19

I need to find the word Lämmönmyyntipalvelut from the database. Only, in the database it is in a field, whose value has been a PHP array, converted into JSO

3条回答
  •  无人及你
    2020-12-03 22:57

    The backslash is a meta character, MySQL understand it this way : "remove the next character and don't parse it as a meta-character".

    So you need to escape the backslash :

    SELECT * FROM table WHERE (services LIKE '%L\\u00e4%')
    

    Now, MySQL will replace "\\" by "\" (the first backslash is a meta character used to escape the second one)

提交回复
热议问题