I can pull content from a mysql database and display it in a table using PHP no prob. I can pull content from a db and display it in a form using the value= attribute no prob. However, if the content contains spaces only the characters before the first space are displayed, all the rest are ignored. How can I fix this bug?
Here's a snippet of my code:
$result = mysql_query("SELECT * FROM contacts WHERE id=$edit");
$row = mysql_fetch_array($result);
echo("<form name='edit_form'><table cellpadding='5' cellspacing='1'>");
echo("<td>Address:</td><td><input type='text' name='Address' size='25' maxlength='50' value=".$row["address"]."></td></tr>");
echo("<tr><td colspan='2' align='center'><input name='submit' type='submit' value='Update Address'></td></tr>");
echo("</table></form>");
The problem is the value should be exactly what I have in the mysql db. In this case, $row["address"] translates into a mysql query which displays the characters from the row (within a db) called "address". Natually, the address contains number, text, and spaces all of which are displayed accurately when the query is done from the mysql prompt or in an html table created using PHP. The problem only occurs when I try to pull this content into an html form created by PHP. What should I do?
Thank you.
~Leif