Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Using ?WHERE= in URL database call

Thank you, we'll take a look.

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Using ?WHERE= in URL database call

This is how the request looks

https://api.appery.io/rest/1/db/colle...

This, with the below code brings all rows back, not just the ones with 6 in the sid coll.

url: 'https://api.appery.io/rest/1/db/colle...',
dataType: 'json',
contentType: 'application/json',
data: {
where: {sid: sid}
},

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Using ?WHERE= in URL database call

What is 'sid'? Is it a variable?
Parameter 'where' should have this format:pre{"sid": "sid"}/prehttp://docs.appery.io/documentation/b...

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Using ?WHERE= in URL database call

The first sid is the name of the colume, the second is a variable. If I enter it like this, in the url, it says 'sid' instead of the number '6' ?

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Using ?WHERE= in URL database call

I have had another play, and still I cannot make it work. Something is wrong with how its sent to the database.

If I add JSON.stringify() it comes back empty, if i remove it, it comes back with all the collection.

What am I doing wrong ?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Using ?WHERE= in URL database call

You don't need to use codeJSON.stringify()/code, if 'sid' is a variable then use parameter 'where' this way:prewhere: {"sid": sid}/pre

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Using ?WHERE= in URL database call

Yes, I have tried this, but still it brings back all rows, and not only the rows where sid = 6

This is what is wrong :(

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Using ?WHERE= in URL database call

I have tried to change the database col from number to string, and back to number, thinking it was that, as the above code from Igor seemed to work.

But still it brings back all records, regardless of the number in sid col

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Using ?WHERE= in URL database call

Hello! Sorry, but we don't see ajax in your urVoice project. There is only service with request to DB and in where parameter you set pre{"area_type" : {ar}. "area" : {an}}/preit's not correct. What do you mean on {ar} and {an}?

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Using ?WHERE= in URL database call

The code I have put above, like that of the original user, which is also me, is for an external website, that needs to do the backend work of the app.

I need the user to get the questions they have asked. The code should send a REST API request to get those questions. But its not giving me the questions where SID = 6, it is giving me all of them.

The where clause is not working, its sending it, but the database returns all records, ignoring the WHERE clause ?

Return to “Issues”