Answer the question
In order to leave comments, you need to log in
How to make a selection from the database on a get request with a filter parameter?
Good day.
There is a get request like api.site.ru/v1/getall?filter=1,3,5
I parse the filter parameter and get 1,3,5
Is it possible to somehow write a query to the database so that it looks like:
SELECT * from EVENTS where event_type =1,3,5
or you have to write everything like this:
SELECT * FROM events WHERE filter = 1 OR filter = 3 OR filter = 5;
Thanks a lot.
ps In api vk there are requests like "filter=post, friend, photo" I need to somehow implement it myself, maybe you know how to do it right?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question