php 参数化查询

WBOY
Release: 2016-06-20 12:54:06
Original
1848 people have browsed it

在学习注入时,MetInfo cms中出现一个注入点,我寻到源代码:

$show = $db->get_one("SELECT * FROM $met_column WHERE id=$id and module=1");
Copy after login

不懂php,看到这个,就误以为这是参数化。参数化不是可以防注入么,怎么还会有注入点呢。

后面深入了解发现。所谓的参数话查询,不是指程序层面的参数话,而是指数据库接口的参数化。 形式:

fetch_one('select * from user where name=?', @name)
Copy after login

对于php采用了参数查询后,是能做到防注入的。

可以了解的php参数化查询资料

  • 使用参数化查询防止SQL注入
  • PHP 中使用参数化查询
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!