Vladimir B. Tsarkov wrote:
After the execution of the script:

<?php
$string = "\n\n\n\n 1";
echo addslashes($string);
?>

we will get:

1

and no empty lines.

If you want to output the same data, that was written using a textarea field of a form, you should use the "<br>" tag.

In one word: kiss. Converting the data before inserting it in the database, and converting it back after reading from the database, is more work and more error-prone, compared to not doing this conversion. You can easily do the conversion when you output the data, _if_ the output format is html, _and_ you actually want "hard" linefeeds in your html output. Many web pages have a variable width... there is a reason for why whitespace usually is not significant in html.

The problem you describe above is not related to mysql, and you could probably solve it another way. You should take a look at the html <pre> element.

--
Roger


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to