Nightasy Posted October 8, 2013 Share Posted October 8, 2013 Greetings all, I have a question about escaping characters prior to entering a field into a database and than echo'ing that escaped data back onto a page. My problem is that the slash marks are echo'ing out of the database onto another page. For instance if I were to do something along the lines of: $hpintrotitle = mysqli_real_escape_string($connect, trim($_POST['hpintrotitle'])); $q = "UPDATE homepage SET mstitle='$hpintrotitle' WHERE msid='1' LIMIT 1"; $r = @mysqli_query($connect, $q); If I place the word "You've" or "Isn't" into that field when I echo it out from the database it comes back as "You\'ve" or "Isn\'t" I know this is probably basic stuff but I apparently missed this lesson in school. Any help would be appreciated. Side note: I am bringing this data back as an array using something along these lines: $rowintro = mysqli_fetch_array ($rintro, MYSQLI_NUM); echo $rowintro; echo $rowintro; and so on.... Thanks for taking a look. Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.