mysql_real_escape_string返回false的问题

开发中用到mysql_real_escape_string进行过滤,调试后发现执行后返回为false。
查了下手册,发现使用这个方法时必须要有mysql连接。

Yes, this means that you have to start a connection before you can escape data... you can't escape the data first, and then use it to build your SQL, and then connect.

Be aware of this when you're designing objects and architecture.

标签: PHP

添加新评论