Importance of link identifier in mysql_real_escape_string ()

Why is it necessary to use the link identifier as input when using mysql_real_escape_string (). I know that this function should be used with MySQL queries, but the function actually just manipulates the string.

+3
source share
3 answers

From the PHP manual :

Resets special characters in unescaped_string, taking into account the current character set of the connection so that it can be placed in mysql_query (). If binary data must be inserted, this function must be used.

and

, , mysql_connect(). , , mysql_connect() . , E_WARNING.

.

+6

http://ilia.ws/archives/103-mysql_real_escape_string-versus-Prepared-Statements.html

, GBK, 0xbf27 (¿) 0xbf5c27 (¿\ GBK - , ). , mysql_real_escape_string() , .

, , mysql ​​ mysql_set_charset(). - mysql ().
, mysql_real_escape_string() ( mysql_set_charset() SET NAMES).
, , script. ( ) real_escape_string(), ( , , ).
, ( , ?) .

+3

mysql_real_escape_string:

Resets special characters in unescaped_string, taking into account the current character set of the connection so that it can be placed in mysql_query ().

+1
source

Source: https://habr.com/ru/post/1726850/


All Articles