我被困在一个不应该成为问题的问题上......
代码:交易
db.transaction(function(tx) {
tx.executeSql(insertStatementElement, [values], doNothing, onError);
});
值示例:
["000096", "The Gold Medal Collection", "Harry Chapin", "Elektra", "140", "AAD", "Rock", "AA8", "32", "2", "7.78", "22.48"]
var insertStatementElement =
"INSERT OR IGNORE INTO Menu" + counter + "
(CDNUMBER, TITLE, ARTIST, LABEL, PLAYINGTIME, RECORDINGTYPE, MUSICTYPE, BINLOCATION, NUMBEROFTRACKS, ONHAND, COST, RETAIL)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?)"
我收到一个错误,即“?”的数量 在sql语句中不匹配。
编辑:如果我对我的代码进行此更改...
var insertStatementElement = "INSERT OR IGNORE INTO Menu" + ebenecounter + " (CDNUMBER) VALUES (?)"
db.transaction(function(tx) {
tx.executeSql(insertStatementElement, [values], doNothing, onError);
});
我得到这个结果