Saving longtext in format typed

Discussion in 'PHP' started by Greenmethod, Dec 16, 2008.

  1. #1
    I am trying to get my database to save the formatting that I use when I type something in a longtext field. For example, when I hit enter twice,

    it should leave a blank line and when I come back to my page it should show the blank line. I'm not sure how to do this... any ideas?

    Thanks in advance.
     
    Greenmethod, Dec 16, 2008 IP
  2. Yesideez

    Yesideez Peon

    Messages:
    196
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you're getting text from a "textbox" then it will be saving those carriage returns inside the database.

    You'll be needing nl2br() to convert those carriage returns to <br />
     
    Yesideez, Dec 16, 2008 IP