2
I’m having a syntax problem trying to place a if
within a echo
in PHP.
Check out the code:
foreach($resultadoBusca as $escrever){
echo "<tr><td>" . $escrever['cod_votoran'] . "</td>
<td>" . utf8_encode($escrever['empresa_user']) . "</td>
<td>" . utf8_encode($escrever['cidade_user']) . "</td>
<td>" . $escrever['estado_user'] . "</td>
<td>" . $escrever['fone_user'] . "</td>
<td>" . $escrever['cpfcnpj_user'] . "</td>
<td>" . $escrever['email_user'] . "</td>
<td>" . $escrever['status_user'] . "</td>
<td>".if($escrever['status_user']=='ativo'){."<a href=\"ativarUsuario.php?cod=".$escrever['cod_user']."\"><i class=\"icon-check\" title=\"Ativar Usuário!\"></i></a>"}."<a href=\"editarUsuario.php?cod=".$escrever['cod_user']."\"><i class=\"icon-edit\" title=\"Editar Usuário!\"></i></a><a href=\"excluirUsuario.php?cod=".$escrever['cod_user']."\"><i class=\"icon-remove\" title=\"Remover Usuário!\"></i></a></td></tr>";
}
I know the mistakes are happening right where the if
. Because if I take it off it works normally. Error that occurs like this.
Is there a reason the down vote?
– Papa Charlie
Also did not understand the down. Simple and direct answer.
– Franchesco
No doubt, this answer was more direct the question.
– Rodrigo Coelho
Congratulations @Papacharlie great response
– Otto