2011-12-15 2 views
0

speical charのように% ' " & [space] ! @ # $ %^* & ()とmysqlステートメントの他の特殊文字を置き換えて処理する方法はありますか?mysqlステートメントの特別な文字を扱う

+0

あなたがテーブルやカラム名にそれを使用する場合は、 '' – Ruben

+0

そうで名前を囲むことができます。これだけ問題を起こしました。別のものでコード化する必要があります。ありがとう。 – kitokid

答えて

1

あなただけescape them (documentation)にあります

Sequence 
\0 An ASCII NUL (0x00) character. 
\' A single quote (“'”) character. 
\" A double quote (“"”) character. 
\b A backspace character. 
\n A newline (linefeed) character. 
\r A carriage return character. 
\t A tab character. 
\Z ASCII 26 (Control+Z). See note following the table. 
\\ A backslash (“\”) character. 
\% A “%” character. See note following the table. 
\_ A “_” character. See note following the table. 
関連する問題