mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-04-18 21:24:07 +03:00
44 lines
1.4 KiB
Groff
44 lines
1.4 KiB
Groff
.\" Automatically generated by Pandoc 3.5
|
|
.\"
|
|
.TH "mysql_real_escape_string" "3" "" "Version 3.3" "MariaDB Connector/C"
|
|
.SS Name
|
|
mysql_real_escape_string \- escape string by taking into account
|
|
character set of connection
|
|
.SS Synopsis
|
|
.IP
|
|
.EX
|
|
#include \f[B]<mysql.h>\f[R]
|
|
|
|
unsigned long mysql_real_escape_string(MYSQL * mysql,
|
|
char * to,
|
|
const char * from,
|
|
unsigned long);
|
|
.EE
|
|
.SS Description
|
|
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.
|
|
.SS Parameter
|
|
.IP \[bu] 2
|
|
\f[CR]mysql\f[R] \- a mysql handle, which was previously allocated by
|
|
\f[B]mysql_init(3)\f[R] and connected by
|
|
\f[B]mysql_real_connect(3)\f[R].
|
|
.IP \[bu] 2
|
|
\f[CR]to\f[R] \- buffer for the encoded string.
|
|
The size of this buffer must be length * 2 + 1 bytes: in worst case
|
|
every character of the from string needs to be escaped.
|
|
Additionally a trailing 0 character will be appended.
|
|
.IP \[bu] 2
|
|
\f[CR]from\f[R] \- a string which will be encoded by
|
|
mysql_real_escape_string().
|
|
.IP \[bu] 2
|
|
\f[CR]long\f[R] \- the length of the \f[CR]from\f[R] string.
|
|
.SS Return value
|
|
Returns the length of the encoded (to) string.
|
|
.SS See also
|
|
.IP \[bu] 2
|
|
\f[B]mysql_escape_string(3)\f[R]
|
|
.IP \[bu] 2
|
|
\f[B]mysql_hex_string(3)\f[R]
|