dlusiondone Posted June 11, 2009 Share Posted June 11, 2009 Hi guys, Having a bit of trouble populating an input text box with results from a table. For some reason it's not posting the entire result, instead it's posting the first word i.e "Seven" instead of the whole result i.e "Seven Pounds". I know its something simple but can't seem to figure it out. I guess that were the experts come in. Thanks in advance by the way. include ("server.php"); $query = "select * from movies"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { echo ("<div id=\"imgTxt\"> <form method=\"post\" action=\"saved_confirm\"> <strong>MOVIE TITLE:</strong> <input type=\"text\" name=\"mTitle\" size=\"40\" maxlength=\"100\" value=" .$row["movie_title"]. " /><p /> <strong>RELEASE DATE:</strong> <input type=\"text\" name=\"mRelease\" size=\"40\" maxlength=\"100\" value=" .$row["release_date"]. "/><p /> <strong>IMAGE NAME:</strong> <input type=\"text\" name=\"imgName\" size=\"40\" maxlength=\"100\" value=" .$row["images"]. " /><p /> <strong>MOVIE RATING:<strong> <input type=\"text\" name=\"mRelease\" size=\"40\" maxlength=\"100\" value=" .$row["ratings"]. " /><p /> <strong>MOVIE DESCRIPTION:</strong><br /> <textarea rows=\"10\" cols=\"40\" name=\"mDescrp\" wrap=\"physical\">" .$row["description"]."</textarea> <hr /></form> </div>"); } Link to comment https://forums.phpfreaks.com/topic/161841-solved-php-input-text-boxes/ Share on other sites More sharing options...
Hatdrawn Posted June 11, 2009 Share Posted June 11, 2009 Not 100% sure but I think it may have to do with the way you set up the field for that in mySQL Link to comment https://forums.phpfreaks.com/topic/161841-solved-php-input-text-boxes/#findComment-853866 Share on other sites More sharing options...
thebadbad Posted June 11, 2009 Share Posted June 11, 2009 You forgot quotes around the values of the value attributes. This should be easy to spot when you look at the source code spat out by PHP. include ("server.php"); $query = "select * from movies"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { echo ("<div id=\"imgTxt\"> <form method=\"post\" action=\"saved_confirm\"> <strong>MOVIE TITLE:</strong> <input type=\"text\" name=\"mTitle\" size=\"40\" maxlength=\"100\" value=\"" .$row["movie_title"]. "\" /><p /> <strong>RELEASE DATE:</strong> <input type=\"text\" name=\"mRelease\" size=\"40\" maxlength=\"100\" value=\"" .$row["release_date"]. "\"/><p /> <strong>IMAGE NAME:</strong> <input type=\"text\" name=\"imgName\" size=\"40\" maxlength=\"100\" value=\"" .$row["images"]. "\" /><p /> <strong>MOVIE RATING:<strong> <input type=\"text\" name=\"mRelease\" size=\"40\" maxlength=\"100\" value=\"" .$row["ratings"]. "\" /><p /> <strong>MOVIE DESCRIPTION:</strong><br /> <textarea rows=\"10\" cols=\"40\" name=\"mDescrp\" wrap=\"physical\">" .$row["description"]."</textarea> <hr /></form> </div>"); } What's with the <p />s? HTML paragraphs are supposed to have content. Link to comment https://forums.phpfreaks.com/topic/161841-solved-php-input-text-boxes/#findComment-853874 Share on other sites More sharing options...
dlusiondone Posted June 11, 2009 Author Share Posted June 11, 2009 You forgot quotes around the values of the value attributes. This should be easy to spot when you look at the source code spat out by PHP. Your a legend. Simple as that. I appreciate it! Link to comment https://forums.phpfreaks.com/topic/161841-solved-php-input-text-boxes/#findComment-854152 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.