How about, I'm developing a system where I have a database filter.
I have the database with a field called "state" where I store 4 different data that are (Pending, Active, Completed, Does not Proceed)
others called "depto1" and another called "depto2" where I store the different types of Headquarters that exist in the company
I need to filter the data where it shows all the fields equal to the "status" that are in "depto1 or depto2"
This is my query: But it is mixing an erroneous data that does not equal the variable "state"
$query = "SELECT * FROM solicitudes
WHERE estado = '$filtro'
and depto1 = '".$usu."'
OR depto2 = '".$usu."'
ORDER BY folio DESC";
What am I doing wrong?