atticus Posted February 27, 2008 Share Posted February 27, 2008 When I insert data into mysql from a form, I keep getting this problem when the data is displayed "we're" is turned into "we/'re". I am inserting the data into a varchar type field. Link to comment https://forums.phpfreaks.com/topic/93382-mysql-insertion-with-php/ Share on other sites More sharing options...
p2grace Posted February 27, 2008 Share Posted February 27, 2008 It's supposed to do that. It keeps mysql safe from hack attempts and sql injection. Link to comment https://forums.phpfreaks.com/topic/93382-mysql-insertion-with-php/#findComment-478362 Share on other sites More sharing options...
atticus Posted February 27, 2008 Author Share Posted February 27, 2008 how can I drop it out when I display information back on the website to the user? Link to comment https://forums.phpfreaks.com/topic/93382-mysql-insertion-with-php/#findComment-478367 Share on other sites More sharing options...
p2grace Posted February 27, 2008 Share Posted February 27, 2008 You can use the stripslashes() command. http://us3.php.net/manual/en/function.stripslashes.php Link to comment https://forums.phpfreaks.com/topic/93382-mysql-insertion-with-php/#findComment-478372 Share on other sites More sharing options...
Neptunus Maris Posted February 27, 2008 Share Posted February 27, 2008 Yeah first use mysql_real_escape_string() to insert the data then use stripslashes() to display that data... Link to comment https://forums.phpfreaks.com/topic/93382-mysql-insertion-with-php/#findComment-478374 Share on other sites More sharing options...
atticus Posted February 27, 2008 Author Share Posted February 27, 2008 thanks ya'll, problem solved Link to comment https://forums.phpfreaks.com/topic/93382-mysql-insertion-with-php/#findComment-478375 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.