我写一个方法来存储导航字符串,但该字符串是这样的:如何在数据库中存储“”?
"data\510000RS\Other\"
因此,它是崩溃:
[SQL] call P_A_OperReg_Bio("liaomalin", "511321199001031598", "P_1", "http:p_1......", "http://p1_url1..", "md5_p1_md51", "http://p1_url2..", "md5_p1_md52", "http://p1_url3..", "","data\510000RS\Other\", "20170202", "", @a);
SELECT @a;
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '20170202", "", @a);
SELECT @a' at line 1
快照:
如何解决这个问题?
如果我有字符串:
data\510000RS\Other\
我怎样才能把它转换为:
"data\\510000RS\\Other\\"
,改成'转义\\\'。 –
@Steve Smith,如何将“\”转换为“\\”?如果我有字符串(“data \ 510000RS \ Other \”) – lme
你以什么方式“拥有”那个字符串?请注意''data \ 510000RS \ Other \“'不是一个有效的java表达式。是你的*实际*字符串数据\ 510000RS \其他\? – luk2302