SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2007
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Addng empty lines in Mysql/php

    I got a problem, I got a long text ( a review) in one of my fields of mysql... now if I look with mysql managment, I got empty lines where needed to break up the text..

    But if I then fetch that record and display that field with $row->Review, it for some reason totally negelcts those empty fields and puts everything after each other, creating one big unreadable text block

  2. #2
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you just echo text the line breaks will have no effect, view the source of your HTML page and you'll see the lines, but whitespace doesn't effect rendering (HTML 101).
    This is not caused by PHP or MySQL.

    You probably need the nl2br function or this paragraphing function to sort it out.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •