Jump to content

addcslashes


robcrozier

Recommended Posts

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!

Link to comment
https://forums.phpfreaks.com/topic/92924-addcslashes/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/92924-addcslashes/#findComment-476016
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.