Last active
December 30, 2015 21:49
-
-
Save NoMan2000/7890148 to your computer and use it in GitHub Desktop.
Filter input, sanitize output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// if the value passed into the GET should be an int. | |
$intStorage = intval($_GET['someValue']); | |
// Using PDO | |
$db = new PDO(); | |
$query = $db->prepare("SELECT someRow FROM table WHERE value = ?"); | |
$query->bindParam(1,$bindedValue); | |
// The first argument is number of prepared statements, second is the value. | |
$query->execute(); | |
// Boolean false if nothing is found. | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment