php – mysql_real_escape_string()完全删除字符串

我正在逃避从PHP表单收到的所有字符串参数,如下所示:
$usr_name = MysqL_real_escape_string($_REQUEST['usr_name']);

避免sql注入的一些问题.但是当我从函数中恢复我的字符串时,我什么都没有结果.

另外,我在PHP日志中不断收到这个奇怪的警告:

PHP Warning:  MysqL_real_escape_string() [<a href='function.MysqL-real-escape-string'>function.MysqL-real-escape-string</a>]: A link to the server Could not be established in /hermes/bosweb/web279/b2798/ipw.bankingforms/public_html/formAckResponse_controller.PHP on line 39

主机使用:PHP版本4.4.7

PHP.net:

Note: A MysqL connection is required
before using
MysqL_real_escape_string() otherwise
an error of level E_WARNING is
generated,and FALSE is returned. If
link_identifier isn’t defined,the
last MysqL connection is used.

换句话说,在使用此功能之前,您需要通过MysqL_connect()或MysqL_pconnect()连接到MysqL数据库.

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...