我寫一個方法來存儲導航字符串,但該字符串是這樣的:如何在數據庫中存儲「」?
"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