0
Hi guys I’m not getting a select in my PHP database. I have tried to implement several solutions, but it always returns 0 Results, and I have data in my BD.
I am using external files to connect to the bank and they are working.
And the contents of spans are always empty.
<?php $idUser = $_SESSION["user_id"];
if (mysqli_num_rows($result) > 0) {
$result = mysqli_query("SELECT idMessage, name, telefone, mensagem FROM Messages where Messages.idUser = '$idUser' ");
while($row = mysql_fetch_array($result)) :
$id = $row["idMessage"];
$name = $row["name"];
$mensagem = $row["mensagem"];
endwhile;
} else {
echo "0 results";
}
?>
<span><?php echo $id ?></span>
<span><?php echo $name ?></span>
<span><?php echo $mensagem ?></span>