MySQL如何知道什么是必需的

编程入门 行业动态 更新时间:2024-10-12 16:28:40
本文介绍了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如何知道什么是必需的

本文发布于:2023-10-31 13:35:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546239.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:MySQL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!