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] ?? 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. 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
Archived
This topic is now archived and is closed to further replies.