How to design database table for dynamic added values in android? -
i have single registration form in application. when user clicks on submit button form, these values stored in database. want design table database, problem have dynamically added values. means have added "add(+)" button. when user clicks button, adds more text fields. if userfills fields, have more fields need entered database.
an example of query:
string create_medicine_table = " create table medicinetable " + "( id integer primary key ," + " class integer ,name text, instructions text , fdate text ,tdate text,time char)";
have fixed schema table default form elements.
for storing data user keeps adding new fields have table bolew
_id, user_id, field_key, field_value
you have 1 many relation main table second table
user_id foriegn key main table has default form entry user
now if case like, dont have default entries in form, all dynamic keys, generate user_id user , follow second table described.
and if dynamic entry value, , there no key, ignore/remove field_key in table.
Comments
Post a Comment