87,907
社区成员
发帖
与我相关
我的任务
分享
var db = window.openDatabase("users", "1",
"My database",
1024);
db.readTransaction(function(tx) {
tx.executeSql("SELECT * FROM t_user where username = :name and score = :score",['小明','80'] function(tx, results) {
var rows = results.rows;
for (var index = 0; index < rows.length; index++) {
var item = rows.item(index);
alert( item.username )
}
});
});
参考 http://hacks.mozilla.org/2010/06/comparing-indexeddb-and-webdatabase/