1
In short, I created a table with type text in sql so that the user can save some content. However when pulling it back into HTML the formatting is lost.
To remedy this I thought of using the tag < pre >, but the tag < pre > fills my layout of bugs, as I recoil too much only in the first paragraph, and does not break the line if the text is too large, it expands the width of the page. Have some own way to maintain this text formatting?
Ps. the code in question must return several records, so there is no way to predict where the line break will appear. The image below was just a random record for testing
Below is the backend code used:
entree:
$query = $conect -> query( 'INSERT INTO textos (texto) VALUES({$_POST['texto']}')');
exit:
$query = $conect -> query("SELECT * FROM textos");
in html / php:
while ($temp = $query->fetch_assoc() ) { ?>
<div><pre>
<?PHP echo $temp['texto']; ?>
</pre></div>
<?php} ?>
What backend language is using?
– Rafael Augusto
Backend am using PHP.
– ARodrigues
Post your code
php
so we can help.– Rafael Augusto
My php has nothing else... A textarea being posted via a form.. and being retrieved via a select. I will post.
– ARodrigues
The question is not what has yours
php
and yes in order to help you, we have to see what has been done.– Rafael Augusto
Code posted.
– ARodrigues
just use the
<p></p>
– Rafael Augusto
Let’s go continue this discussion in chat.
– ARodrigues