Xtremer360 Posted March 17, 2010 Share Posted March 17, 2010 I have a field in my database called height and obviously an example would look like 5'6". I am calling that row and it shows up as 5'6 and doesn't include that following quotation mark. I'm supposed to escape it somehow I think but not sure how. Any tips? Quote Link to comment https://forums.phpfreaks.com/topic/195597-escaping-a-quotation/ Share on other sites More sharing options...
premiso Posted March 17, 2010 Share Posted March 17, 2010 Look into mysql_real_escape_string as that will escape any information going into the database properly. Quote Link to comment https://forums.phpfreaks.com/topic/195597-escaping-a-quotation/#findComment-1027753 Share on other sites More sharing options...
Xtremer360 Posted March 17, 2010 Author Share Posted March 17, 2010 Still doesn't show that following quotation. Am I dong something wrong still? $query = "SELECT s.hometown, s.height, s.weight, h.kowtitles, h.kowawards, w.nicknames, w.finisher, w.setup, w.music FROM `efed_bio_singles` AS s, `efed_bio_history` AS h, `efed_bio_wrestling` AS w WHERE s.bio_id = '$defaultcharacterid' AND h.bio_id = '$defaultcharacterid' AND w.bio_id = '$defaultcharacterid'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $height = mysql_real_escape_string($height); And then this in the form: <?php echo $row['height']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/195597-escaping-a-quotation/#findComment-1027760 Share on other sites More sharing options...
Xtremer360 Posted March 17, 2010 Author Share Posted March 17, 2010 Did some research and came up with <?php echo htmlspecialchars($row['height']); ?> and it works. Quote Link to comment https://forums.phpfreaks.com/topic/195597-escaping-a-quotation/#findComment-1027773 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.