0

我正在使用phonegap在Android中执行一些DB(SQL)操作......虽然一切正常,但在查询执行时我也遇到了不必要的错误......这是我的代码

var db = window.openDatabase("something", "1.0",
                            "PhoneGap Demo", 0);
                    db.transaction(someFunction, errorCB);

function someFunction(tx) {

    tx.executeSql('SELECT md5_value from md5_table where category = 1', [],
            gettingMd5QuerySuccess, errorCB);

}

function gettingMd5QuerySuccess(tx, results) {

        tx.executeSql('UPDATE md5_table set md5_value = "' + tempValue
            + '" where category = 1', successCB, errorCB);

    }

function errorCB(err) {
    alert("Error processing SQL: " + err);
}

我究竟做错了什么?

4

1 回答 1

1

我在做一个语法错误...我需要替换

tx.executeSql('UPDATE md5_table set md5_value = "' + tempValue
        + '" where category = 1', successCB, errorCB);

经过

tx.executeSql('UPDATE md5_table set md5_value = "' + tempValue
        + '" where category = 1', [], successCB, errorCB);
于 2012-04-12T13:46:27.533 回答