Line break between record of a table

Asked

Viewed 61 times

-1

I’m having a hard time making the line break in a table query...

For example I have 1 table with ID 1, 2, 3, ...
I want when you give the select it shows

1    
2    
3

But it’s showing

1 2 3

follows the code:

$resultado_noticia = mysqli_query($conexao, "SELECT substring(texto, 1, 200) from noticias where ativo='1'") or die (mysqli_error());
$linhas = mysqli_num_rows($resultado_noticia);
for ($i = 0; $i < $linhas; $i++)
{
     $linhas = mysqli_fetch_row($resultado_noticia);
     echo $linhas[0];
}       

mysqli_close($conexao);

After the word Members was to give 1 row space to separate the content, but it’s all together...

inserir a descrição da imagem aqui

  • Hello @Andre, Welcome to Sopt, I don’t know if I understand your question, but it seems to me you need a (or more) <br> when you use the echo leaving +/- like this echo $linhas[0] . "<br>";

  • 1

    Good evening Icarus... Our saved me I had tried it yesterday but without the spaces did not roll did as I said now was success. Thank you very much

2 answers

1

My friend is just using
To break the line automatically

Resultado: echo $linhas[0] . "<br>";

-2

Hello,

You can increment the tag <br> and it will be broken automatically.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.