How to escape apostrophe (') in MySql?

前端 未结 10 781
孤城傲影
孤城傲影 2020-11-22 07:49

The MySQL documentation says that it should be \\\'. However, both scite and mysql shows that \'\' works. I saw that and it works. What should I d

10条回答
  •  感动是毒
    2020-11-22 08:14

    I think if you have any data point with apostrophe you can add one apostrophe before the apostrophe

    eg. 'This is John's place'

    Here MYSQL assumes two sentence 'This is John' 's place'

    You can put 'This is John''s place'. I think it should work that way.

提交回复
热议问题