I'm having a syntax problem when trying to put a if
inside 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 that errors are occurring well in the part where if
starts. Well if I take it out it works normally. This is an error.