Ads Posted May 24, 2010 Share Posted May 24, 2010 I am Pulling the name of an item from the Database into a Text Field, However if the name from the Database is more than one word it only Displays the First word and Curts off the Rest of the words. Do i need to add a PHP Command to tell it to not do this? Link to comment https://forums.phpfreaks.com/topic/202724-php-variable-into-text-field/ Share on other sites More sharing options...
kenrbnsn Posted May 24, 2010 Share Posted May 24, 2010 Code? Link to comment https://forums.phpfreaks.com/topic/202724-php-variable-into-text-field/#findComment-1062557 Share on other sites More sharing options...
Ads Posted May 24, 2010 Author Share Posted May 24, 2010 Ah Sorry. $id = $_REQUEST['id']; $db = mysql_query("SELECT * from weps where id=$id"); $a=mysql_fetch_array($db); Name: <input type='text' name='name' value=$a[name]> Link to comment https://forums.phpfreaks.com/topic/202724-php-variable-into-text-field/#findComment-1062574 Share on other sites More sharing options...
kenrbnsn Posted May 24, 2010 Share Posted May 24, 2010 You need to enclose the value in quotes: <?php echo 'Name: <input type="text" name="name" value="' . htmlenitites($a['name'],ENT_QUOTES) . '">'; >?> Ken Link to comment https://forums.phpfreaks.com/topic/202724-php-variable-into-text-field/#findComment-1062579 Share on other sites More sharing options...
Ads Posted May 24, 2010 Author Share Posted May 24, 2010 Working, Thank you Link to comment https://forums.phpfreaks.com/topic/202724-php-variable-into-text-field/#findComment-1062793 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.