-1
I have the following code in the modal:
if ($resultado2 > "")
foreach ($resultado2 as $grupo2):
echo '<tr>';
echo '<td>'.($grupo2->id_valormedicaofauna).'</td>';
echo '<td>'.($grupo2->nome_filo).'</td>';
echo '<td>'.($grupo2->nome_classe).'</td>';
echo '<td>'.($grupo2->nome_subclasse).'</td>';
echo '<td>'.($grupo2->nome_ordem).'</td>';
echo '<td>'.($grupo2->nome_familia).'</td>';
echo '<td>'.($grupo2->nome_genero).'</td>';
echo '<td>'.($grupo2->nome_especie).'</td>';
/*aqui rodamos o if para descobrir o score da coleta**/
if($grupo2->nome_familia == 'Phryganeidae' ||
$grupo2->nome_familia == 'Odontoceridae' ||
$grupo2->nome_familia == 'Brachycentridae' ||
$grupo2->nome_familia == 'Helicopsychidae'||
$grupo2->nome_familia == 'Gripopterygidae' ||
$grupo2->nome_familia == 'Leptophlebiidae')
echo '<td>'."10".'</td>';
else
echo '<td>'."0".'</td>';
But he’s not in if
, goes straight to else
. If I delete Else it shows no result on the screen.
tried to highlight shape too, but did not succeed
switch ($grupo2->nome_familia){
case "Odontoceridae":
echo '<td>'."10".'</td>';
break;
case "Phryganeidae":
echo '<td>'."10".'</td>';
break;
}
Did you try printing $Grupo2->family name before entering if to see what is returning? asks the question where you’re submiting this as well and if possible, insert the code into a Codepen.
– Maurício Krüger
Probably $Grupo2->family name is coming in empty or with a name that does not match the options.
– Maykel Esser