如何在 MySQL 中插入由单引号或双引号组成的值.即
How do I insert a value in MySQL that consist of single or double quotes. i.e
This is Ashok's Pen.
单引号会产生问题.可能还有其他转义字符.
The single quote will create problems. There might be other escape characters.
如何正确插入数据?
简单地说:
SELECT 'This is Ashok's Pen.';
因此在字符串内部,将每个单引号替换为两个.
So inside the string, replace each single quote with two of them.
或者:
SELECT 'This is Ashok\'s Pen.'
逃脱它 =)
这篇关于如何在 MySQL 中转义单引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!