jdh23 Posted May 30, 2007 Share Posted May 30, 2007 Hi folks, I have a field in a mysql table like "...We Also Walk Dogs". If I call it with while($row = mysql_fetch_array($result)) {... .... $title = $row['title']; ... I can go echo $title and the output will be "...We Also Walk Dogs" with quotes as shown. but when I try to display it in a <form> like this <input id="title" name="title" size="50" value="<? echo $title ?>"><br> nothing shows up. If this field has no quotes, eg. We Also Walk Dogs it shows up fine. Is there something else I should do to make this field display as a value in a form? Thanks, --John Quote Link to comment https://forums.phpfreaks.com/topic/53631-solved-retrieving-a-field-containing-quotes/ Share on other sites More sharing options...
kenrbnsn Posted May 30, 2007 Share Posted May 30, 2007 Use the function htmlentities() with the option ENT_QUOTES when displaying the value. <input id="title" name="title" size="50" value="<?php echo htmlentities($title,ENT_QUOTES) ?>"> Ken Quote Link to comment https://forums.phpfreaks.com/topic/53631-solved-retrieving-a-field-containing-quotes/#findComment-265102 Share on other sites More sharing options...
jdh23 Posted May 30, 2007 Author Share Posted May 30, 2007 Beautiful! Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/53631-solved-retrieving-a-field-containing-quotes/#findComment-265108 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.