Answer the question
In order to leave comments, you need to log in
Form a query to the database?
Conditionally in the table there are 2 columns (owner_id, object_id)
I have to pass a specific owner_id and a list (array) of object_id's to the request and get a check whether all object_ids belong to the owner_id.
If some owner_id - object_id pair is missing - then false
Answer the question
In order to leave comments, you need to log in
SELECT COUNT(DISTINCT object_id) FROM table WHERE owner_id=$owner_id AND object_id IN($object_ids)
count($object_ids)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question