If you want to ignore the tipo
of 2
completely, it would be ideal not to get them from the database, using for example:
$query = "SELECT * FROM tabela WHERE tipo != 2";
If the 2
is maximum type, can use the tipo < 2
.
Thus the mysqli_fetch_object
will get only the values where the tipo
is not 2
, no need to handle this in PHP.
Another option, different from the others, is to use the GOTO
, there jmp
:
while($pessoa = mysqli_fetch_object($query)){
if($pessoa->tipo === '2'){
goto fim;
}
echo 'Você não é 2!'; // Executa o que tem que fazer.
fim: // Se ele for `2` ele vem direto para cá. :D
}
Test this.
You can do something like
if($pessoa->tipo != 2){ //executa todas ações...}
when type is 2 no record will be displayed. If you need only one record of type 2 to be skipped add a flag to control this.– rray
Check it out:https://answall.com/questions/207170/para-que-serve-o-controle-de-fluxo-continue
– Marconi