为什么输入的关键字不存储在数据库中? [英] Why entered key word is not store in database?

查看:68
本文介绍了为什么输入的关键字不存储在数据库中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在表格上做了一个文字区域.
现在我将文本区域的数据存储到mysql数据库中.
现在,如果我按Enter键,那么它就不会存储在数据库中.
因为我没有得到我输入的精确输出.

I had made on form, in which i had one text area.
Now i am storing that data of text area to mysql database.
Now if i had press enter key word then it not stores in the database.
Because i don't get exacted output as what i entered.

例如...

如果我写过这样的书.....

If i had write like this.....


早晨
你好吗?

Good
Morning
How are you?

那我只能这样...

then i only get like this...

早上好,你好吗?

Good Morning How are you?

因此它不存储在数据库中输入关键字的内容.

So its not storing that enter key word in the database.

推荐答案

您应使用 nl2br ,然后将其存储.

You should convert the textarea content with nl2br then store it.

它将换行符转换为<br />

这篇关于为什么输入的关键字不存储在数据库中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆