dpzp5127 2012-11-28 09:53
浏览 68

mysql_real_escape字符串错误

I'm trying to set up a codeigniter web app I just recently finished on a server. I wrote it locally on my own computer. However when I try to login I get these two errors.

A PHP Error was encountered

Severity: Warning

Message: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO)

Filename: mysql/mysql_driver.php

Line Number: 319



A PHP Error was encountered

Severity: Warning

Message: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established

Filename: mysql/mysql_driver.php

Line Number: 319

Anyone know what the problem is?

  • 写回答

4条回答 默认 最新

  • dragon87836215 2012-11-28 09:55
    关注

    The answer is simple: mysql_real_escape_string() (the hint is in the name) escapes a string based on the receiving character set used by the DB connection. In order to use this, you first need to be connected to a MySQL server!

    Auto-load the DB class and have it auto-connect. It'll solve your problem.

    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!