I had that problem once. Although they are optional, you have to use quotes around your values to get the whole string, otherwise HTML thinks it ends at the first space:
<input type=text name=street value="<?php print $street ?>" size=30>
Of course, then you may have some quote issues, so you should use stripslashes when you grab it from the database:
$street = stripslashes($query_data["street"]);
That should fix it.