Query MySql comparing with PHP array

0

I need to mount a SQL query to search for more than one value.

Type:

SELECT * FROM tabela WHERE id = 10 OR id = 20 .....

But I found this option:

SELECT * FROM tabela WHERE id IN (' . implode(',', array_map('intval', $idgrupos)) . ')

It works, but the problem is that the id has to be equal to all idgrupos passed in the array. I wanted it to return if I found at least one equal in the array. How do I?

    
asked by anonymous 27.06.2017 / 14:10

0 answers