Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do you break up addresses into street / city / state / zip?

My current app needs to store address information for a user. I'm currently debating whether to use the customary street address / city / state / zip textboxes and dropdowns or to go with Google's method of simply having everything on one line. Any thoughts on the pros/cons of storing address information in either of these manners?

like image 335
Kevin Pang Avatar asked Oct 30 '08 02:10

Kevin Pang


2 Answers

You should split it up. It will make it far easier to do reporting down the road. What happens if you want to pull up all the residents of a state or zip code, or city? If you use all one field, you will be stuck and wish you had split it up.

Also, users will forget to put in all the information you need if you don't prompt them for it.

like image 73
Georg Zimmer Avatar answered Oct 14 '22 21:10

Georg Zimmer


Judging by the user-input tag on your post, I assume you are referring to how the user enters the data, and now how you are storing the data in your back-end database.

Presumably your database will still need to store this information as separate fields, if you want to be able to sort and analyse the information (e.g. for reporting and statistics purposes).

In this case, I think it would depend on how confident you are that you could parse the addressing information properly into its individual fields.

One hybrid option would be to allow the user to enter the address as a single line, and then do a best-effort parsing of the information into the separate fields. This is similar to how Outlook manages addresses for contacts - you enter all of the information into a single memo field, and then it splits it up for you. You can then correct if it interpreted any of the fields wrong.

like image 45
LeopardSkinPillBoxHat Avatar answered Oct 14 '22 22:10

LeopardSkinPillBoxHat