Insert the data in phonegap database table?

北战南征 提交于 2019-12-03 21:52:21

Use Cordova 2.0.0 and your issue will be solved.. You will be able to see the database you created in the file explorer. Do let me know if it helps you.

Arindam, do not forget by default the executing of the sql is asyncronious. Therefore nobody warranty your sqls will be executed in order you have defined in function populateDB(tx). Eg. it could execute first create than delete...

To be sure in the order you have to define subsequent calls in the callback function

function populateDB(tx) {
     tx.executeSql('DROP TABLE IF EXISTS DEMO', function () {
         tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)', function () {
             console.log("Table created");
         });
     });
}

Cheers, Oleg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!