Nolongerused3921 Posted January 22, 2007 Author Share Posted January 22, 2007 I tried it before I said no, and it didn't work.And parser is the class that contains the functions I posted in the first post. Quote Link to comment https://forums.phpfreaks.com/topic/35265-mysql_real_escape_string-breaking-n/page/2/#findComment-166774 Share on other sites More sharing options...
Nolongerused3921 Posted January 22, 2007 Author Share Posted January 22, 2007 Well I'm one step closer, I found this on php.net:[quote]Note that mysql_real_escape_string doesn't prepend backslashes to \x00, \n, \r, and and \x1a as mentionned in the documentation, but actually replaces the character with a MySQL acceptable representation for queries (e.g. \n is replaced with the '\n' litteral). (\, ', and " are escaped as documented) This doesn't change how you should use this function, but I think it's good to know. [/quote]Now to figure out how to convert that into real \n... Anyone know how? I'm not having any luck on php.net Quote Link to comment https://forums.phpfreaks.com/topic/35265-mysql_real_escape_string-breaking-n/page/2/#findComment-166793 Share on other sites More sharing options...
Nolongerused3921 Posted January 23, 2007 Author Share Posted January 23, 2007 Since the moderators found it necassary to delete my new thread, and I am unable to edit this thread... I need someone to edit the title and content to reflect this new problem that has surfaced....Title: Need to fix Mysql_real_escape_string's \n to work with nl2brContent:I am having a bit of a problem with mysql_real_escap_string, it seems it converts \n and the like to special mysql safe strings that php doesn't read correctly, and I need to figure out how to convert these back to something PHP understands so nl2br isn't broken.[quote]Note that mysql_real_escape_string doesn't prepend backslashes to \x00, \n, \r, and and \x1a as mentionned in the documentation, but actually replaces the character with a MySQL acceptable representation for queries (e.g. \n is replaced with the '\n' litteral). (\, ', and " are escaped as documented) This doesn't change how you should use this function, but I think it's good to know. [/quote] Quote Link to comment https://forums.phpfreaks.com/topic/35265-mysql_real_escape_string-breaking-n/page/2/#findComment-166833 Share on other sites More sharing options...
redbullmarky Posted January 23, 2007 Share Posted January 23, 2007 try [url=http://www.php.net/str_replace]str_replace[/url] Quote Link to comment https://forums.phpfreaks.com/topic/35265-mysql_real_escape_string-breaking-n/page/2/#findComment-167028 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.