javascript - How to get value of a string for a db.transaction -


i'm stuck on problem should not problem ...

code: transaction

db.transaction(function(tx) {     tx.executesql(insertstatementelement, [values], donothing, onerror); }); 

example values:

["000096", "the gold medal collection", "harry chapin", "elektra", "140", "aad", "rock", "aa8", "32", "2", "7.78", "22.48"]

var insertstatementelement =     "insert or ignore menu" + counter + "      (cdnumber, title, artist, label, playingtime, recordingtype, musictype, binlocation, numberoftracks, onhand, cost, retail)       values (?,?,?,?,?,?,?,?,?,?,?,?)" 

i got error number of '?' in sql statement not match.

edit: if change on code...

var insertstatementelement = "insert or ignore menu" + ebenecounter + " (cdnumber) values (?)" db.transaction(function(tx) {     tx.executesql(insertstatementelement, [values], donothing, onerror); }); 

i result

table example

can remove [] characters around [values], line reads:

tx.executesql(insertstatementelement, values, donothing, onerror); 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

c++ - End of file on pipe magic during open -