0

I have one MySQL database field which saves comment from users. Some comments have new lines but when I try to use PHP to display the contents of the database, the new lines are ignored. I know about nl2br() but I guess it will not work as my users will not bear to write /n or /r/n or /r.

My column type is LONGINT and another problem is that if quotation marks exist in the comment, the comment doesn't get stored in the database.

I have more information to provide, I use textarea and use "POST" method.

I want reply as soon as possible.

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Nahiyan
1

another problem is that if quotation marks exist in the comment, the comment doesn't get stored in the database.

for this use addslashes($str);

1

are your comment text?
The u can't store them in a longint. Just use TEXT as ur column type
If there are numerical i don't see the problem with new lines

0

I changed my column type to TEXT. Sorry my column's type was LONGTEXT before.
I have used nl2br in a different way and now it works :D

Edited by Nahiyan: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.