Why entered key word is not store in database?
I had made on form, in which i had one text area.
Now i am storing that data of text area to mysql database.
as example...
If i had write like this.....
Good
MorningHow are you?then i only get like this...
Good Morning How are you?
So i开发者_如何学JAVAts not storing that enter key word in the database.
You should convert the textarea content with nl2br
then store it.
It will convert your newlines to <br />
My guess is you are outputting HTML which doesn't render line breaks. Try using nl2br()
.
I am sure the \n character is stored in the database. However it wont be rendered if you display the output on a web page. Just replace \n with <br >
If you are displaying your stored text as HTML then \n
are getting ignored. PHP has nl2br()
function that would convert linebreaks to <br>
, just run your text through it before displaying.
精彩评论