我如何防止用php和mysql进行sql注入 [英] How do I prevent sql injection with php and mysql
本文介绍了我如何防止用php和mysql进行sql注入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个访问者可以在其中输入数据的表单,我想通过$ _POST变量将此数据存储在mysql数据库中.我需要什么来防止sql注入?
I have a form into which the visitor can enter data, and I want to store this data in a mysql database via the $_POST variable. What do I need to prevent sql injection?
推荐答案
Use prepared statements.
这篇关于我如何防止用php和mysql进行sql注入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文