Hi I am using the following code to insdert data into mysql table:
$sql="INSERT INTO DB (spanish, english)
VALUES
('$_POST[spanish]','$_POST[english]')";
than here is the input form:
<form action="insert.php" method="post">
<p>bulgarian text:</p>
<p>
<textarea type="textarea" cols="45" rows="5" name="bulgarian"></textarea>
</p>
<p>
english text:</p>
<p>
<textarea type="textarea" cols="45" rows="5" name="english"></textarea>
</p>
<p>
<input type="submit">
</p>
</form>
and this is the display procedure:
while($row = mysql_fetch_array($result))
{
echo "<td>" . $row['english'] . "</td>";
}
my problem now is once I put the text inside the database , and than once I display it it is displayed without any formatting. I would like to know how to make it to be displayed the way it is entered inside the text area with all the formatting and the new lines
thanks.
Any data put into a
<textarea>is in plain text. When you put that data in a HTML-formatted page, the browser will “collapse” the whitespace.There are two options:
<pre>and</pre>, so the formattingstays intact.
nl2brto create (rudimentary) HTML.