name = str(name).replace('\'', '\'\'')

'单引号,会导致SQL语句被截断,产生错误

如:’/"

a = a.replace('\\', '\\\\')