【发布时间】:2012-12-13 09:20:42
【问题描述】:
我正在使用 PHP 5.3 版并尝试在我的代码中使用 mysql_real_escape_string($unescaped_string),但出现错误:
Fatal error: Call to undefined function mysql_real_escape_string()
in /var/www/engine/database.php on line 38
但是,我仍然可以连接到数据库。为什么不可用?
我使用的是 PHP 5.3 版。
【问题讨论】:
-
请向我们展示您的代码
-
改用 mysql_escape_string()
-
@jtheman 你为什么建议用更差的功能(只是简单的字符串替换)替换更好的功能(考虑到服务器配置)?
-
你怎么知道可以获取数据库
-
mysql_real_escape_string()是因为mysql_escape_string()存在漏洞而创建的,强烈建议不要使用!