|
PHP5中文手册
mysqli_real_escape_stringmysqli->real_escape_string()(PHP 5) mysqli->real_escape_string() — Escapes special characters in a string for use in a SQL statement, taking into account the current charset of the connection 说明Procedural style:
string mysqli_real_escape_string
( mysqli $link
, string $escapestr
)
Object oriented style (both methods are equivalent): mysqli
string escape_string
( string $escapestr
)
string real_escape_string
( string $escapestr
)
This function is used to create a legal SQL string that you can use in an SQL statement. The given string is encoded to an escaped SQL string, taking into account the current character set of the connection. 参数
返回值Returns an escaped string. 范例Example#1 Object oriented style
<?php Example#2 Procedural style
<?php 上例将输出:
|