Reputation: 5075
I need to store postal addresses for my users, but I don't plan on really doing much with these addresses other than displaying it (won't be searching users by location or anything). In this scenario, is it ok to just have an addresses table which holds an address id, user id, and one text field where users can enter in the data anyway they want? Thx for your time!
Upvotes: 2
Views: 203
Reputation: 95532
Sure, it's ok to use a single column to store an entire address, as long as all these criteria apply to you and your app.
Upvotes: 3
Reputation: 36512
The data is only as valuable as you make it.
If you perform no validation, and the string is used for display purposes only, then go for it. But consider that the time and cost to implement proper validation and field separation now might pay off big time in the future.
Upvotes: 3
Reputation: 4048
Yes you can do this if you are absolutely sure you dont need to search or validate any part of the address. It will work fine for data storage and retrieval just as well as splitting it out
Upvotes: 2
Reputation: 3031
If all you're doing is displaying these addresses then I think it's perfectly fine. Just remember to insert things into your database securely!
Upvotes: 1
Reputation: 5520
Sure, no reason you couldn't, just make sure to test your user input data to avoid any potential problems down the road.
Upvotes: 0