seb hughes Posted May 21, 2007 Share Posted May 21, 2007 When i use this it makes you're become you\'re. When i pull the data from the database how do i get it to go back to you're? Link to comment https://forums.phpfreaks.com/topic/52317-solved-mysql_real_escape_string/ Share on other sites More sharing options...
marcus Posted May 21, 2007 Share Posted May 21, 2007 The function mysql_real_escape_string, will escape all apostrophes, making the input value more secure. To retrieve the data back to its normal state use stripslashes. <?php $sql = "SELECT * FROM myTable"; $res = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($res); $msg = stripslashes($row[message]); echo "Message: $msg"; ?> Link to comment https://forums.phpfreaks.com/topic/52317-solved-mysql_real_escape_string/#findComment-258119 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.