MySQL selecting string with special characters

后端 未结 3 1702
我寻月下人不归
我寻月下人不归 2021-01-21 15:33

I\'m having a problem selecting strings from database. The problem is if you have McDonald\'s in row and if you are searching with a string mcdonalds i

3条回答
  •  难免孤独
    2021-01-21 16:33

    Escape your special characters.

    SELECT *
    FROM restaurants
    WHERE name='McDonald\'s';
    

提交回复
热议问题