警告:mysql_real_escape_string()[function.mysql-real-escape-string]:无法在服务器中建立到服务器的链接 [英] Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in

查看:219
本文介绍了警告:mysql_real_escape_string()[function.mysql-real-escape-string]:无法在服务器中建立到服务器的链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Internet Web服务器上执行我的PHP脚本时收到此警告消息,但是在本地沼泽中,它在没有警告的情况下工作.是什么原因?

I got this warning message when executing my PHP script in Internet webserver, but in local wamp it is working without warnings. what is the reason ?

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/deport/public_html/abc/index.php on line 209

推荐答案

mysql_real_escape_string()需要与MySQL服务器的活动连接,如果没有,将使用php.ini配置中的默认数据来启动一个.

mysql_real_escape_string() needs an active connection to the MySQL server and will initiate one with the default data from the php.ini configuration if there is none.

在未首先连接到数据库之前,请勿使用此功能.

Do not use this function without first connecting to the database.

也不要使用mysql_ *函数.它们已弃用,将从PHP中删除.

Also, do not use the mysql_* functions. They are deprecated and will be removed from PHP.

这篇关于警告:mysql_real_escape_string()[function.mysql-real-escape-string]:无法在服务器中建立到服务器的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆