Reading info from sqlite database, Syntax? How do I use it in html5 webapp?

后端 未结 2 1592
一生所求
一生所求 2021-01-22 15:02

I have a webapp that I\'m building, and have just started with SQLite. I have been able to create my form, open the database I created, create the table, and fields i need, and

2条回答
  •  自闭症患者
    2021-01-22 16:01

    try something like this

    tx.executeSql('SELECT * FROM foo', [], function (tx, results) {
                 var len = results.rows.length;
                 for (var i = 0; i < len; ++i) {
                    var obj = results.rows.item(i);
                    alert(obj);
                  }
              });

    also see this for short tutorial http://html5doctor.com/introducing-web-sql-databases/

提交回复
热议问题