Hi I am trying to build a form to edit Mysql data, however when I retrieve the data and display it in a form input text box, all characters after the first space are cut off.
When I echo out the variable value immediately before inserting into the form, the data displays correctly (ie. full name instead of just the first name).
I have tried adding a character before inserting into the form using the following code:
$record[‘skip’] = str_replace(’ '," ",$record[‘skip’]);
and this sort of works, however it actually adds a  character (ASCII 194) to the data.
An extract of my code is:
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' />
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.