Page 1 of 1

Database query on local storage

Posted: Tue Apr 23, 2013 10:12 pm
by Gert Vanwijn

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 ?


Database query on local storage

Posted: Tue Apr 23, 2013 10:14 pm
by maxkatz

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


Database query on local storage

Posted: Tue Apr 23, 2013 10:16 pm
by Gert Vanwijn

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..


Database query on local storage

Posted: Tue Apr 23, 2013 10:20 pm
by Gert Vanwijn

Also note that userid holds a number not a string


Database query on local storage

Posted: Tue Apr 23, 2013 10:22 pm
by maxkatz

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


Database query on local storage

Posted: Tue Apr 23, 2013 10:23 pm
by Gert Vanwijn

So how do I pass it as a number ?


Database query on local storage

Posted: Tue Apr 23, 2013 10:25 pm
by maxkatz

Database query on local storage

Posted: Tue Apr 23, 2013 10:42 pm
by Gert Vanwijn

Still no solution


Database query on local storage

Posted: Wed Apr 24, 2013 12:50 am
by maxkatz

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


Database query on local storage

Posted: Wed Apr 24, 2013 7:54 am
by Gert Vanwijn

Ok thanks Max !