Data stored in database properly in browser but in mobile not

i tried to implement Remember me functionality in my app. if in my database value already there,it’s display and data not available in database,inserted it.
Problem is that this functionality worked in browser properly when i run in android device i get error. In database data not stored and tried to access it gives undefined error.

Code that i used
let options = {
name: this.dbName, // the name of the database
backupFlag: SqlStorage.BACKUP_LOCAL, // where to store the file
existingDatabase: false // load this as an existing database
}; = new Storage(SqlStorage, options);

Functions for update or insert data.

public saveLoginDetail(table: string, username:string, password:string){

        var sql = 'INSERT INTO ' + table + ' VALUES ( ?, ?)';
public updateLoginDetail(table: string, username:string, password:string){
        var sql = 'UPDATE '+ table +' SET '+this.COLUMN_userId +' = ?,'+ this.COLUMN_password+' = ?';

Below function tried to access database value

 this.db.getData(this.db.sqtable_UserInfo).then(data => {
     console.log('Done - insert1',data.res.rows[0]); <-- undefined error
     },err => AllFunctions.doAlert('Error Occured - 108',this.navController));

If data is not stored in database, then you should try to print the error by"INSERT INTO " + table + " VALUES ('"+ username + "','" + password +"')" ) .then(data => console.log("Value Inserted");, error => console.log("Error -> "+JSON.stringify(error.json())))

and for accessing table value your code should be (assuming all the other function parameters are fine)
console.log('Done - insert1 ' + data.res.rows.item(0));
this will print the first row of your table. You can even try
console.log('Total number of records in table = '+data.res.rows.length);

i used your code but i get error … data.res.rows.item is not function

and if i write like this data.res.rows.item[0] then i got 0 is undefined error

All right. Can you tell me if the insert query is working or not, are you getting “Value Inserted”(as per the above code) in your console. What does data.res.rows.length shows?

This command used to work for me but I see that the plugin has been updated and I am not active on ionic since 3 months. Can you tell me your sqlite version?

sqlite version – 1.4.5

yes insert query work but when i try to access i got undefined

might be possible it take length of undefined??

1st time insert – undefined
2nd time insert – undefined