SharkBait Posted August 29, 2006 Share Posted August 29, 2006 What is the difference between:[code=php:0]str_replace("'", "\'", $mystring);[/code]and[code=php:0]mysql_real_escape_string($mystring);[/code] ?? Quote Link to comment https://forums.phpfreaks.com/topic/19052-which-one-str_replace-mysql_real_escape_string/ Share on other sites More sharing options...
wildteen88 Posted August 29, 2006 Share Posted August 29, 2006 mysql_real_escape_sting escapes other characters, such as whitespace, quotes, hex, slashes (\x00, \n, \r, \, ', " and \x1a)Where as your code just escapes single quotes. Quote Link to comment https://forums.phpfreaks.com/topic/19052-which-one-str_replace-mysql_real_escape_string/#findComment-82389 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.