/ Published in: PHP
Sometimes when you use addslashes, you may end up with double // in front of the string and start getting incorrect results, this is because is getmagicquotesgpc on. This function let's you add just single slash to the string irrespective of the setting of getmagicquotesgpc.
Expand |
Embed | Plain Text
// quote variable to make safe function quote_smart($value) { { } { } return $value; }
Comments
Subscribe to comments
You need to login to post a comment.

you should also check for the result of mysqlrealescapestring and if it's false, use mysqlirealescapestring since new installations of PHP dont use mysql, they use mysqli... Might be better as a try/catch statement but I think a simple
if ( ($value = mysqlrealescapestring($value) === false) { $value = mysqlirealescapestring($value); } else {}
even then you should check the response of mysqlirealescape_string for a false (mysqli not installed).. but I guess you gotta draw the line and stop somewhere :P