1
I have a table in the database called acting, in which generated the`s ID of the areas chosen by the user ex: 1,5,4,9,15
I need the result of the query in Mysql return me all users who have been selected in a checkbox list
someone can give me a light on how to perform this search, even without repeating the user if it fits in more than one chosen area of action?
I will simplify with Consultation IN, that the result was the same
Using
SELECT * FROM usuarios WHERE atuacao_usuario IN (1,5,6)
Show me the results postpussuo users in the table already with these areas selected as in the image
Now remove the number 1 from the query SELECT * FROM usuarios WHERE atuacao_usuario IN (5,6)
does not return any results
Enter part of the code you’ve already made in php.
– Andrei Coelho
Good afternoon @Andreicoelho, I don’t have much concrete yet, I just created a common query,
– Marcos Paulo
Oops... better now I can answer
– Andrei Coelho
WHERE atuacao_usuario IN (1,5,8,7); https://www.w3resource.com/mysql/comparision-functions-and-operators/in-function.php
– user60252
There’s an Edit I put in the answer. Try it later.
– Andrei Coelho