In MySQL database, I have a table in which there is a field named features. I have nearly 20 features to store there. I am trying to retrieve these features from my Android mobile application. In app, it has to be shown as line by line (so 20 lines in total). Is there anyway to store the 20 features in that single field by doing something like \n? Or is there anyway to get those features in new lines by doing something in my android app?
In MySQL database, I have a table in which there is a field named
Share
Firstly, this is almost certainly a terrible idea…by storing the features in a single field, you make it very hard to query and manage. For instance, finding all records where feature “x” is available requires you to parse the feature field in some way, which will almost certainly not make use of any indexing on the column.
If you have no choice, you have two options: store the features as some kind of string representation (XML, JSON, CSV), or store the features as a bit flag.
I strongly recommend using a structured text format – JSON is probably the most lightweight – because it’s human readable, and easily parsed.