form, textarea. how to wrap text (address) for input into database?

My form textarea has wrap="hard". I input into database and then retrieve and echo it page. It dose not wrap. I changed table field type from varchar to text, but still it echo's back as one long string. This is a postal address. How do I go about doing this? Thanks.

Instead of using textarea, should the input be 3 or 4 fields.? Name, street, city, state, zip etc.
kadinAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GaryCommented:
Are you doing anything with the content before you put it in the db or before you put it back in the textarea?
0
kadinAuthor Commented:
no.
0
GaryCommented:
Try with the following in your textarea

<?=nl2br($your_string);?>

It probably would be better to separate them, I don't know what you are doing with the information but it certainly makes maintenance easier and in the future you may need for example to do a search in your db for people in a certain city.
It also helps with normalizing your database and not having unnecessary large fields.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

kadinAuthor Commented:
Thanks so much. That worked.
0
kadinAuthor Commented:
When you say.
It also helps with normalizing your database and not having unnecessary large fields.
Do you mean it is better to break up the address name, street, city etc. to store into database?

I will be copying the postal address from an email and inputting it myself into a form to store in database. Then print it to a webpage.
0
GaryCommented:
Whichever works the best and easiest for you.  If all you are doing is storing the address with no intention of doing anything else with the data then keep on storing it in one field.
0
kadinAuthor Commented:
Thanks again.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.