Posted by bill on 12/23/06 20:18
from: http://us3.php.net/mysql_real_escape_string
// Quote variable to make safe
function quote_smart($value)
{
// Stripslashes
if (get_magic_quotes_gpc()) {
$value = stripslashes($value);
}
// Quote if not a number or a numeric string
if (!is_numeric($value)) {
$value = "'" . mysql_real_escape_string($value) . "'";
}
return $value;
}
However when I pass it a null string it returns just a single
double quote.
It would be easy to fix, but I don't understand why it does this.
bill
Navigation:
[Reply to this message]
|