-
Notifications
You must be signed in to change notification settings - Fork 110
Preventing SQL Injection Attacks
Lin Canbin edited this page Mar 21, 2015
·
1 revision
####Safety: Use parameter binding method Safety Example:
<?php
$DB->query("SELECT * FROM fruit WHERE name=?", array($_GET['name']));
?>####Unsafety: Split joint SQL string Unsafety Example:
<?php
$DB->query("SELECT * FROM fruit WHERE name=".$_GET['name']);
?>