I have a webiste that uses at textarea for input, which is then submitted to a mysql database for storage. Then i output from the mysql to another page. Using this code:
$row = mysql_fetch_array($result);
echo "<p class='Bodys'>".nl2br($row'Announcement'])."</p>";
The only problem is it seems like it takes out all of the spaces.
Like if someone puts:
This is_________a_______good_thing.
where the underscores are spaces. I couldn't put just spaces because this forum has the same problem as me.The html just ignores the extra spaces.
It will show up on the output page as:
This a good thing.
If I look at the database it is stored with the spaces and if i put the variable into a textarea it keeps the spaces. But I don't really want to put it in a textarea. Is there a way to stop this. I tried using this:
$row = mysql_fetch_array($result);
echo "<p class='Bodys'><pre>".$row'Announcement']."</pre></p>";
but then i get just one long line.
Thanks for any info