Jump to content

[SOLVED] Database value not the same as FORM value displayed


paulrjacques

Recommended Posts

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

 

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.