-- 处理mysql转义字符
local mysqlEscapeMode = "[%z\'\"\\\26\b\n\r\t]";
local mysqlEscapeReplace = {
['\0']='\\0',
['\''] = '\\\'',
['\"'] = '\\\"',
['\\'] = '\\\\',
['\26'] = '\\z',
['\b'] = '\\b',
['\n'] = '\\n',
['\r'] = '\\r',
['\t'] = '\\t',
};
local function mysqlEscapeString(s)
return string.gsub(s, mysqlEscapeMode, mysqlEscapeReplace);
end
Lua处理mysql转义字符
最新推荐文章于 2023-08-10 23:03:40 发布