1
In the while words are appearing several times, example:
macarrão
macarrão
macarrão
macarrão
macarrão
macarrão
arroz
arroz
arroz
arroz
arroz
arroz
What am I doing wrong?
<?php
$usuario=$_SESSION['email'];
require_once 'Classes/ProjetosVO.php';
require_once 'Classes/ProjetosDAO.php';
$mysqli = new mysqli('localhost', 'root', '', 'bdpi');
$objBDProjeto=new ProjetosDAO();
$objProjeto= new ProjetosVO();
$rsProjeto= $objBDProjeto->ListarProjetos("1");
$sqlProjetos="select P.codigo_PROJETO, P.nome_PROJETO from projetos P, usuarios U, funcoes F where U.email_USUARIO like '$usuario' and U.email_USUARIO=F.emailUsuario_FUNCAO and U.email_USUARIO=P.responsavel_PROJETO and F.status_FUNCAO=1 ";
$rsProjeto= mysqli_query($mysqli, $sqlProjetos) or die (mysqli_error($mysqli));
$tblProjeto=mysqli_fetch_array($rsProjeto);
?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>
<script src="https://use.fontawesome.com/eb2dfeaa2c.js"></script>
<br>
<br>
<center><h1 class="Titulo">Meus Projetos</h1></center>
<?php
include 'FormCadastraProjeto.php';
?>
<?php
while($tblProjeto==mysqli_fetch_array($rsProjeto)){
?>
<a href="Projeto.php?codProjeto=<?=$tblProjeto['codigo_PROJETO'];?>" > <h1><i class="fa fa-folder" aria-hidden="true"></i></h1>
<?php
echo $tblProjeto['nome_PROJETO'];
?>
</a>
<?php
}
?>
2 times? $mysqli = new mysqli('localhost', 'root', '', 'bdpi');
– user60252