-1
我目前正在構建一個phonegap應用程序。基本SQLlite sql更新失敗,出現嚴重錯誤
一頁包含允許登錄用戶更新基本設置的表單。在這個頁面上,我有一個「更新」按鈕,它調用一個JS函數,用更改後的設置更新數據庫。但是,我似乎無法獲得最基本的更新工作。
繼承人(非常簡化)的例子。
function updateSettings(tx) {
tx.executeSql('UPDATE USERS SET (username) VALUES ("edit") WHERE id = 1');
}
db.transaction(updateSettings, errorCB);
運行這個(和幾乎所有其他的更新香港專業教育學院試過)給了我這個錯誤:
Error processing SQL: could not prepare statement (1 near "(": syntax error)
稍微更復雜的查詢我本來試圖運行是這樣的:
tx.executeSql('UPDATE USERS SET (username, password, userId, defaultHandler, autoSync, updateCT, updateHistorical, updateFavorite, signedIn) VALUES ("'+ username +'", "'+ password +'", "plUserId", "Default Handle", "'+ sync +'", "' + updateCaseTypes + '", "' + updateHistoricalCases + '", "' + updateFavoriteCases +'", "1") WHERE id = 1');
任何人都可以指向正確的方向嗎?
非常感謝提前