I'm making a comment section in my site and I have this problem, everything goes fine in the php code but it keeps increasing the height of the td, I've tried to set a max-height but didn't worked, I thought about making that it only echoes the ten last comments but i don't have any idea how to do this. This wont be a professional site, is just an activity from high school.
<tr ><td colspan="4">
<?php
$conexao = mysqli_connect("127.0.0.1","root","","db_tcc") or die ("Não foi possível se conectar com o servidor.");
$varsql = "SELECT * FROM tb_comentarios WHERE estado='pe' ORDER BY id DESC";
$carregar_comentarios = mysqli_query($conexao, $varsql);
while ($linha = mysqli_fetch_array($carregar_comentarios))
{
$user = $linha["user"];
$texto = $linha["texto"];
$data = $linha["data"];
echo "$user: $texto - $data<BR>";
}
?>
</td></tr>