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 Quote Link to comment 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. Quote Link to comment 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.