<?
/* Voorbeeld Mysqli Injection voorkoming */ 
/*
// Connect to the database
$mysqli     = new mysqli("localhost", "root", "", "yourdb");    
 
// Prepare the query
$sql         = $mysqli->prepare('SELECT * FROM persons WHERE Id = ?');
 
// The id
$_GET["id"] =  "1";
 
// Bind the parameter, i --> int, datatype of column
$sql->bind_param('i', $_GET["id"]);
 
// Execute SQL
$sql->execute();
    
// Get metadata
$metadata     = $sql->result_metadata();
 
// Get the data, in this case a row
$row         = array();
while($field = $metadata->fetch_field()) {
        $row[]  = $field->name;
}
// Close connection
$sql->close();

http://indieteq.com/index/readmore/how-to-prevent-sql-injection-in-php
*/

show_source(__FILE__);
?>