note 74073 deleted from function.filter-var by derick
| From: | derick@php.net | Date: | Mon, 21 May 2007 10:19:20 +0000 |
| Subject: | note 74073 deleted from function.filter-var by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-126787@lists.php.net to get a copy of this message | ||
Note Submitter: george dot enciu at designmysoftware.com
----
the filter_var function is a very good function for preventing some sql injections.
in the example below we make sure that the entity that we pass to the sql query is an int
$getID = filter_var($_GET['id'],FILTER_VALIDATE_INT);
$sql = 'SELECT * FROM myTable WHERE id = '.$getID;