Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Question about SQLStorage and retrieving many rows

$
0
0

@icarus_31 wrote:

Hi,

Quick one for you.

Here, from Ionic example:

storage.query('insert into projects(name, data) values("Cool Project", "blah")');
storage.query('select * from projects').then((resp) => {})

If the "select" returns more than one records, how can I get columns info from "resp" for each rows?

I have something like

resp.res.rows[0].column1
resp.res.rows[0].column2
resp.res.rows[1].column1
resp.res.rows[1].column1

but does not seems to work. It is ok on Chrome directly with ionic serve, but when using "Chrome inspect directly with a phone, it does not return correctly the value:

EXCEPTION: Error: Uncaught (in promise): TypeError: Cannot read property 'column1' of undefined

Thanks

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles