robcrozier Posted February 25, 2008 Share Posted February 25, 2008 Hi, I wonder if someone can help me here. I'm trying to use addcslashes to escape data that is inserted into my mysql database. The function IS working (does add slashes to the string to be inserted) however when the actual string is inserted into the database, the slashes are not present? They simply don't show up? Is there any specific reason for this? I was of the impression that you addslashes()/addcslashes() when inserting and the stripslashes() when retrieving. Any help would be appreciated, thanks! Quote Link to comment https://forums.phpfreaks.com/topic/92924-addcslashes/ Share on other sites More sharing options...
kenrbnsn Posted February 25, 2008 Share Posted February 25, 2008 You should use the function mysql_real_escape_string() instead and, no the backslashes are not stored in the database. If "magic_quotes_runtime" is enabled in the php.ini, then you would have to use stripslashes() on the data after it's been retrieved. Ken Quote Link to comment https://forums.phpfreaks.com/topic/92924-addcslashes/#findComment-476016 Share on other sites More sharing options...
robcrozier Posted February 25, 2008 Author Share Posted February 25, 2008 Thanks Ken, i'll use that function instead Quote Link to comment https://forums.phpfreaks.com/topic/92924-addcslashes/#findComment-476019 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.