I created a sqlite database file using sqlite browser.I have a sample.sqlite file, now I wanted to know how to import this file into javascript and use the data in sqlite file. I used this below mentioned script
var db; try { if (window.openDatabase) { db = openDatabase("sample.sqlite", "1.0", "HTML5 Database API example", 200000); if (!db) alert("Error Failed to open the database, check version"); } else alert("Error Not supported? Not gonna happen"); } catch(err) {}
Using this code, I cannot get data from sqlite file. Please suggest me how to proceed. I saw some sites that mentioned the steps to create a table, insert data by writing code in a java script itself. But I do not know to do it this way, I want to import an existing sqlite file.
source share