MySQL Connector/Python 發行說明
語法
str = ccnx.escape_string(str_to_escape)
使用 mysql_escape_string() C API 函式來建立可用於 SQL 陳述式中的 SQL 字串。
如果值不具有 Unicode、bytes 或 (對於 Python 2) string 類型,則會引發 TypeError 例外。如果字串無法逸出,則會引發 MySQLError 例外。
語法
str = ccnx.escape_string(str_to_escape)
使用 mysql_escape_string() C API 函式來建立可用於 SQL 陳述式中的 SQL 字串。
如果值不具有 Unicode、bytes 或 (對於 Python 2) string 類型,則會引發 TypeError 例外。如果字串無法逸出,則會引發 MySQLError 例外。