'
Python のトリプル クォーテーションで囲まれた文字列を使用すると、 、バッククォートを含む文字列を定義できますが、"
気にする必要はありません。
hello = """
This string is bounded by triple double quotes (3 times ").
Unescaped newlines in the string are retained, though
it is still possible to use all normal escape sequences.
Whitespace at the beginning of a line is
significant.
This string ends in a newline.
"""
PHP では、ヒアドキュメント( <<<
)を使用できます。
$str = <<<EOD
Example of string
spanning multiple lines
using heredoc syntax.
EOD;
MySQLで同じことを行うにはどうすればよいですか? 現在、区切り文字として使用する文字をエスケープする必要があります。たとえば、'
区切り文字として使用する場合\'
は、文字列で使用する必要があります。
UPDATE article
SET article_text ='
Extra-virgin olive oil is a staple in any chef\'s kitchen.
'
私は次のようなことができるようにしたいと思います
UPDATE article
SET article_text ='''
Extra-virgin olive oil is a staple in any chef's kitchen.
'''