0
That is the code:
<?php
$conexao = mysqli_connect("localhost", "root", "");
mysqli_select_db($conexao, "videoaula");
?>
<?php
$sql = "select comentarios.id, comentarios.comentario, usuarios.email from comentarios, usuarios order by id desc";
$executar = mysqli_query ($conexao, $sql);
while ($exibir = mysqli_fetch_array ($executar)){;
echo "<strong>ID:</strong>".$exibir ["email"];
echo "<br/>";
echo "<strong>Comentário:</strong>".$exibir ["comentario"];
echo "<br/><br /><br />";
}
?>
When I execute the code, appears all registered emails, as below:
ID:thaina123
Comentário:olá mundo!!
ID:[email protected]
Comentário:olá mundo!!
ID:[email protected]
Comentário:olá mundo!!
ID:[email protected]
Comentário:olá mundo!!
Hello, thank you for your reply! But how do I save user id in comment table?
– Thaina Lopes