Gert Vanwijn
Posts: 0
Joined: Wed Mar 27, 2013 1:19 pm

Database query on local storage

Hi,

I'm trying to execute a query with a local storage variabel in the where-clause.
This is my javascript for the where-parameter:

var value1 = localStorage.getItem('userid');

return '{"ReceiverID":"value1"}';

But it won't return anything ?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Database query on local storage

Please use browser dev. tools to test whether you are sending the correct request and if there are any errors.

Gert Vanwijn
Posts: 0
Joined: Wed Mar 27, 2013 1:19 pm

Database query on local storage

This is the correct request because I tested the service with the value that is stored in the 'userid'-variable and it gave me the correct results..

Gert Vanwijn
Posts: 0
Joined: Wed Mar 27, 2013 1:19 pm

Database query on local storage

Also note that userid holds a number not a string

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Database query on local storage

I think the way you have it, it's passed as string.

Gert Vanwijn
Posts: 0
Joined: Wed Mar 27, 2013 1:19 pm

Database query on local storage

So how do I pass it as a number ?

Gert Vanwijn
Posts: 0
Joined: Wed Mar 27, 2013 1:19 pm

Database query on local storage

Still no solution

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Database query on local storage

code
var myCount = 6;
return "{'count':"+myCount+"}&quot
/code

Gert Vanwijn
Posts: 0
Joined: Wed Mar 27, 2013 1:19 pm

Database query on local storage

Ok thanks Max !

Return to “Issues”