wwfc_barmy_army Posted October 27, 2007 Share Posted October 27, 2007 Hello. I have this code: <?php $result = mysql_query("SELECT title FROM optionaltext WHERE id= 1"); $row = mysql_fetch_array($result); $titletoedit = $row['title']; //to test value echo $titletoedit; ?> Title: <input name="title" type="text" value=<?php echo $titletoedit; ?> size="50" maxlength="30"/> <br/><br/> The variable $titletoedit gets the field which has some text data in which is 'Optional Text 1', when using echo it shows 'Optional Text 1', but when i try to display it in the textbox it just says 'Optional'. Any ideas why? Thanks. Link to comment https://forums.phpfreaks.com/topic/75034-solved-problem-with-displaying-field-in-text-box/ Share on other sites More sharing options...
marcus Posted October 27, 2007 Share Posted October 27, 2007 Put it in quotes. value="<?php echo $titletoedit; ?>" Link to comment https://forums.phpfreaks.com/topic/75034-solved-problem-with-displaying-field-in-text-box/#findComment-379405 Share on other sites More sharing options...
wwfc_barmy_army Posted October 27, 2007 Author Share Posted October 27, 2007 Ahhh. Silly mistake Thanks. Link to comment https://forums.phpfreaks.com/topic/75034-solved-problem-with-displaying-field-in-text-box/#findComment-379407 Share on other sites More sharing options...
marcus Posted October 27, 2007 Share Posted October 27, 2007 Mark as solved. Link to comment https://forums.phpfreaks.com/topic/75034-solved-problem-with-displaying-field-in-text-box/#findComment-379408 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.