Thiatt
Thiatt

Reputation: 574

cordova android sql select returning length 1 but no rows

I'm having some weird behaviour on this app I'm developing. While testing on browser everything seems to work fine, but I tried deploying my app on a device to test and apparently everything WebSQL related works fine up until I do a select. My SQLResultSet is returning length = 1 on the rows but there are no rows there. I tried to inspect the app and look at the Resources tab on chrome and the database IS created and there is actually one row there. So it is returning the right length but not the rows.

Anyone had anything like this?

Upvotes: 2

Views: 778

Answers (1)

Thiatt
Thiatt

Reputation: 574

I was supposed to use the result.rows.item(idx) method on the result rows but I was fetching the rows directly through result.rows[idx]. Apparently this is supported by Chrome's implementation but is not standard. Using result.rows.item(idx) fixed it.

Upvotes: 7

Related Questions