douchang6770 2012-06-02 15:41
浏览 299
已采纳

将用户输入插入到用户设置的mysql数据库中(带换行符)

I am looking to insert a user's input from a textarea into a mysql database. As of now, if the user types the following:

"Hello.


hello."

It will be inserted into the database without the line breaks. How can I fix this?

  • 写回答

3条回答 默认 最新

  • duancao1951 2012-06-02 15:43
    关注

    If using PHP, i suggest using $message = nl2br($message);

    This will turn line breaks into br's for you.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)
编辑
预览

报告相同问题?