paulrjacques Posted October 8, 2007 Share Posted October 8, 2007 Help, I'm sure this is an easy one for most of you. My database 'city' field says "La Mesa" but the FORM displays "La". Somehow the space between the words is causing a problem. What am i doing wrong and how can I fix it? CODE SNIPPET: echo $row['city']; // reading from the database, this displays "La Mesa" <form method="post" name="myform" action="Level_3_Edit_Record_Script.php"> <strong>City:</strong> <input type="text" name="city" size=20 maxlength=20 align="center" value=<?php print $row['city']?>> <P><input type="submit" name="submit" value="Submit"></p> //The display shows "La" only. Thanks, Paul Link to comment https://forums.phpfreaks.com/topic/72365-solved-database-value-not-the-same-as-form-value-displayed/ Share on other sites More sharing options...
pocobueno1388 Posted October 8, 2007 Share Posted October 8, 2007 Try putting quotes around the variable, like this <input type="text" name="city" size=20 maxlength=20 align="center" value="<?php print $row['city']; ?>"> You also forgot the semi-colon to end the print statement. Link to comment https://forums.phpfreaks.com/topic/72365-solved-database-value-not-the-same-as-form-value-displayed/#findComment-364974 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.