Okay, sorry.
Code:
mysql_connect("----","----","----") or die ("Cannot Connect to Database");
mysql_select_db("----") or die ("could not select database");
$sql1="SELECT * FROM selectedtable WHERE email='----'";
$result1=mysql_query($sql1) or die (mysql_error());
while($row = mysql_fetch_array($result1)){
$checktest=$row['services_array'];
echo $row['public_company_name'];
if ($row['public_company_name']!=null)
{
echo 'Displayed Company Name: <input type="text" name="public_company_name" value=';
echo $row['public_company_name'];
echo ' size="30"><br>';
}
else
echo 'Displayed Company Name:
<input type="text" name="public_company_name" value="" size="30"><br>';
okay so that is the code I am using. It works from what I can tell. But it only returns the first word in the string.
I tried using
$public_company_name=str_replace(" "," ",$_POST['public_company_name']);
which uploaded a between the words and worked... or so I thought. But when the user submits the form again without changing the default it replaces the $nbsp; with  and a space behind the symbol.
I tried
Code:
$public_company_name=str_replace("Â "," ",$row['public_company_name']);
to echo the code on another page after pulling it from the database but it wouldn't replace the  . It just stayed the same. I accomplished the goal of showing the database entry in the form but caused another problem.
Is there a better way to display the value from the database in the form or do I have to just keep fiddling with it until I can get something to work?
Bookmarks