creating a simple blog in PHP/SQL - having trouble ...

Discussion in 'Programming' started by Kevin Design, Aug 4, 2008.

  1. #1
    Hi, Im trying to create a simple blog using php/sql - everythings going ok, but i have one problem:

    when i enter the text through a <textarea> any paragraphs or newlines dont show once entered into the database then retrieved and echoed onto a page, the text just shows as one block of text.

    how can i make sure that any newlines entered into the <textarea> is showed on the blog?

    hope this makes sense ....

    thanks in advance :)
     
    Kevin Design, Aug 4, 2008 IP
  2. rohan_shenoy

    rohan_shenoy Active Member

    Messages:
    441
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    60
    #2
    use nl2br() while either storing or retrieving.
     
    rohan_shenoy, Aug 4, 2008 IP
  3. Kevin Design

    Kevin Design Guest

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks rohan, i will try that when i get in later ;)
     
    Kevin Design, Aug 5, 2008 IP