本文介绍了MySQL如何知道什么是必需的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用CodeIgniter构建一个网站。这是我自己建立的与数据库进行交互的第一个站点。我在这个项目中使用MySQL。如何将数据保存到数据库之前如何进行转义?解决方案
如果您使用数据库类与查询绑定,您不需要执行任何手动转义:
使用绑定的次要优点是值被自动转义,从而产生更安全的查询。你不必记得手动转义数据;引擎为您自动执行。
I'm in the process of building a site with CodeIgniter. This is the 1st site that I've built myself that interacts with a database. I'm using MySQL for this project. How can I tell if data needs to be escaped before saving it to the database?
解决方案If you're using the database class with query bindings, you don't have to do any manual escaping:
The secondary benefit of using binds is that the values are automatically escaped, producing safer queries. You don't have to remember to manually escape data; the engine does it automatically for you.
更多推荐
MySQL如何知道什么是必需的
发布评论