Data view does not work

0

I need to display records coming from the database, I'm doing this through a while and inserting each field into a td, but if I do not limit the number of records in the select itself, they all stay on the same line (td). Here is the code:

$select  = "SELECT descricao, nome, datahora_final, valor, tipo_valor FROM teste limit 1";  
$hoje    = date('Y-m-d');
$result  = mysqli_query($conexao, $select);
while($exibe = mysqli_fetch_assoc($result)){ 
     echo '<td>' . $exibe['descricao']      . '</td>';
     echo '<td>' . $exibe['nome']        . '</td>';
     echo '<td>' . $exibe['datahora_final'] . '</td>';
     echo '<td>' . $exibe['valor']          . '</td>';
}     
mysqli_free_result($result);

If someone has a suggested how to solve it, thank you in advance!

    
asked by anonymous 29.03.2017 / 14:07

1 answer

0

Hello, this is just a matter of logic.

  

try adding tr tag

$select  = "SELECT descricao, nome, datahora_final, valor, tipo_valor FROM teste";  
$hoje    = date('Y-m-d');
$result  = mysqli_query($conexao, $select);
while($exibe = mysqli_fetch_assoc($result)){ 
     echo '<tr>';
       echo '<td>' . $exibe['descricao']      . '</td>';
       echo '<td>' . $exibe['nome']        . '</td>';
       echo '<td>' . $exibe['datahora_final'] . '</td>';
       echo '<td>' . $exibe['valor']          . '</td>';
     echo '</tr>';
}     
mysqli_free_result($result);
    
29.03.2017 / 14:09