Classic error, you are not quoting the string value correctly in your html.
The best way to understand fully what is going on is to look at the source code of your form.
Correctly formatted html should look like this:
<input type=text name = "a_name" value = "I just don't care" />
You probably have
<input type=text name = "a_name" value = I just don't care />
In that example the name attribute actually does not need quoting because it contains no spaces, whereas the value attribute does, so needs to be correctly quoted - either single or double quotes will do.
So you just add some extra quotes, HOWEVER, dont end up with this: (single quotes containing a single quote)
<input type=text name = 'a_name' value = 'I just don't care' />
Something like this:
echo '<td><input type=text name=third value="' . $record['third'] . '" /></td>';
Look into using something to correctly escape the values you are outputting to correctly escape double quotes too.
So you need to plan carefully which quotes you will be outputting where. Investigate other ways of doing it, my preference would be to use single quotes in PHP to join up the values, and output double quotes in HTML. I does not matter much which system you adopt but the thing is to stick with only one scheme.
Look at the [string section of the manual for a fuller explanation as well as [URL="http://stackoverflow.com/questions/1097135/escape-double-quotes-of-html-attributes-output-by-php"]here ](http://php.net/manual/en/language.types.string.php)for a discussion on sprintf, heredoc and templates.