mysql_real_escape字符串错误 [英] mysql_real_escape string errors

查看:262
本文介绍了mysql_real_escape字符串错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置一个codeigniter网络应用程序,我刚刚在服务器上完成。我在本地在我自己的电脑上写了。

遇到PHP错误



严重性:警告



邮件:mysql_real_escape_string $ b [function.mysql-real-escape-string]:拒绝用户访问
'ODBC'@'localhost'(使用密码:NO)



文件名:mysql / mysql_driver.php



行号:319


< blockquote>








遇到PHP错误 strong>:mysql_real_escape_string()
[function.mysql-real-escape-string]:指向服务器的链接不能
建立



文件名:mysql / mysql_driver.php



行号:319


< blockquote>

任何人都知道问题是什么?

解决方案

连接到您的db



您可以修改 application / config / database.php



您应该使用

  $ this-> db-> escape )

详细信息和示例可以在这里找到
http://ellislab.com/codeigniter/user-guide/database/queries.html


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?

解决方案

First make sure you are connect to your db

you can modify the settings in application/config/database.php

for codeigniter you should use

$this->db->escape() 

Details and samples can be found here http://ellislab.com/codeigniter/user-guide/database/queries.html

这篇关于mysql_real_escape字符串错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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