getLocalDBData = () => {
let SQLcmd = "SELECT * FROM" + localDB.tableName.Employee+ " WHERE Name LIKE "+ this.state.EName;
console.log(SQLcmd)
db.transaction(tx => {
tx.executeSql(
SQLcmd,
[],
(tx, results) => {
var len = results.rows.length;
if (len > 0) {
for (let i = 0; i < len; i++) {
let row = results.rows.item(i);
console.log("Employee Id:" + row.Name);
// this.setState({output:row.Name})
this.setState((prevState) => ({ data : prevState.data.push(row.Name)}))
}
}
// Get rows with Web SQL Database spec compliance.
/*let rows = results.rows.raw();
this.setState({ data: rows })*/
}
);
});
}