note 91504 modified in function.mysql-real-escape-string by danbrown
| From: | danbrown@php.net | Date: | Sun, 14 Jun 2009 14:28:12 +0000 |
| Subject: | note 91504 modified in function.mysql-real-escape-string by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-156854@lists.php.net to get a copy of this message | ||
I always use this function so I don't have to retype over and over the mysql_real_escape_string
function.
<?php
function safe($value){
return mysql_real_escape_string($value);
}
?>
Then, when I am using my code, I simply use:
<?php
$name = safe($_POST["name"]);
$password = safe($_POST["password"]);
?>
--was--
I always use this function so I don't have to retype over and over the mysql_real_escape_string
function.
function safe($value){
return mysql_real_escape_string($value);
}
Then, when I am using my code, I simply use:
$name = safe($_POST["name"]);
$password = safe($_POST["password"]);
http://php.net/manual/en/function.mysql-real-escape-string.php