Error in Query Mysql

0

I have a page in php that needs to query in 3 fields on Mysql Bank.

Campo Aprovado
Campo Reprovado
Campo Resolution

$select = mysql_query("select * from denuncia where (resolution is NOT NULL) 
AND status='aprovado' or status='reprovado'");

This Query only returns the Disapproved field, but needs to return everything that is in an approved status, disapproved, and the Resolution field is not null.

Where am I going wrong?

    
asked by anonymous 26.01.2018 / 19:28

1 answer

0

Hello

You should write your query as follows:

select * from denuncia where resolution IS NOT NULL AND (status='aprovado' OR status='reprovado')
    
26.01.2018 / 19:48