I need to compare the id contained within a php array, with those of a field in a mysql table. The idea is NOT to show the id (of the php array) in the mysql query response.
$consulta="SELECT * FROM permisos_pedidos WHERE id_cliente = '$id_us' AND id = '$trat'";
$ejecutar_consulta = $conexion->query($consulta);
$perm = array();
while ($registro = $ejecutar_consulta->fetch_assoc())
{
$perm[] = $registro["etapas"];
}
$ perm is my array that contains the ids of the users.
Now, what I need, is that in another query, do not show me the id of the users that are in $ perm. What the array shows me (which is correct):
array(2) { [0]=> string(1) "9" [1]=> string(2) "10" }
Where 9 and 10 are the ids that I should not show in the next query. Any ideas on how to make this comparison? As always, thank you very much everyone.