Prefer table(dateformat,papersize,enablepass,currency)
params table(newpassword,oldpassword,dateformat,papersize,enablepass,currency,secretq,secretans)
These are the two tables I am working with.Prefer table details insertion is done in prefer.js and params table in params.js.On insertion the datas are inserted like.
for example:
prefer
dateformat ,papersize ,enablepass ,currency
dd/mm/yy , 4 , yes , $
params table appears like this:-
newpassword ,oldpassword, dateformat , papersize, enablepass , currency, secretq , secretans
qwer , asdf , - , - , - , - , dfg , dgdfg
- , - , dd/mm/yy , 4 , yes , $ , - , -
the dateformat,papersize ,enablepass and currency is inserted in another line:-my code says to do the same, I need to know how to insert the fields together in one line?
something like this:-
params table:-
newpassword, oldpassword, dateformat , papersize , enablepass , currency, secretq , secretans
qwer , asdf , dd/mm/yy , 4 , yes , $ , dfg , dgdfg
prefer.js
db=openDatabase(masterDbName,version,displayName,maxSize);
db.transaction(function (tx)
{
tx.executeSql('INSERT INTO preferences(date_format,paper_size,currency_symbol,password)VALUES(?,?,?,?)',[$('.date option:selected').val(),$('#paper_size').val(),$('.currency option:selected').val(),$('.password option:selected').val()],populate_success,transaction_error );
tx.executeSql('INSERT INTO params(date_format,paper_size,currency_symbol,enable_pword)VALUES(?,?,?,?)',[$('.date option:selected').val(),$('#paper_size').val(),$('.currency option:selected').val(),$('.password option:selected').val()],populate_success,transaction_error );
});
params.js
db=openDatabase(masterDbName, version, displayName,maxSize);
db.transaction(function(transaction)
{
transaction.executeSql('insert into params(new_password,old_password,secret_question,secret_answer)values(?,?,?,?)',[ $('#pass1').val() ,$('#pass2').val(),$('#question').val(),$('#answer').val()],populate_success,transaction_error );
});
I hope the question is clear by my words..please help