SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    Non-Member
    Join Date
    Jan 2004
    Location
    Seattle
    Posts
    4,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pasting Articles in phpMyAdmin

    Imagine the following text in a Dreamweaver or Notepad file:

    Code:
    The cheetah isn't just the fastest
    cat - it's the fastest of all mammals.
    Not even the speedy impala can
    always escape a cheetah's deadly
    rush.
    I just created a new table with some text fields for articles. When I paste an article into phpMyAdmin, it preserves the line breaks, so the above article might look something like this:

    Code:
    The cheetah isn't just
    the fastest
    cat - it's the fastest of
    all mammals.
    Not even the speedy
    impala can
    always escape a
    cheetah's deadly
    rush.
    Is there a way to make the text flow freely, or is something that no one worries about?

    Thanks.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by geosite View Post
    Is there a way to make the text flow freely
    text flows freely by default

    assuming, of course, that we are talking about displaying the article text on a web page

    use P tags, or even, at worst, TD tags, but not PRE tags, because PRE tags preserve line breaks
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    Non-Member
    Join Date
    Jan 2004
    Location
    Seattle
    Posts
    4,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    text flows freely by default

    assuming, of course, that we are talking about displaying the article text on a web page

    use P tags, or even, at worst, TD tags, but not PRE tags, because PRE tags preserve line breaks
    Actually, I was referring to making the text flow freely in phpMyAdmin. I just thought it might make it a tiny bit easier to edit my articles. But I suppose it isn't that big a deal as long as the text flows freely when displayed. Thanks.

  4. #4
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,578
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by geosite View Post
    Actually, I was referring to making the text flow freely in phpMyAdmin. I just thought it might make it a tiny bit easier to edit my articles. But I suppose it isn't that big a deal as long as the text flows freely when displayed. Thanks.
    Turn off word wrap in whatever editor you're pasting from, since that's where the line breaks are coming from.

  5. #5
    Non-Member
    Join Date
    Jan 2004
    Location
    Seattle
    Posts
    4,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Grossman View Post
    Turn off word wrap in whatever editor you're pasting from, since that's where the line breaks are coming from.
    Thanks.

  6. #6
    Non-Member
    Join Date
    Jan 2004
    Location
    Seattle
    Posts
    4,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Turning off word wrap in Dreamweaver or Notepad

    I want to remove the line breaks from some articles before I paste them into my database table via phpMyAdmin. I was told to turn off word wrap in my text editor...

    http://www.sitepoint.com/forums/show...=1#post3420386

    So I quickly learned how to turn off word wrap in both Dreamweaver and Notepad. The only problem is it doesn't work in either one! I turn off word wrap, and my text remains formatted. If I copy the text from Dreamweaver and paste it into Notepad AFTER I've turned off word wrap, the results are the same.

    So what's the magic trick to turning off word wrap? Thanks.

  7. #7
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Word wrap has nothing to do with actual line breaks. Word wrap is only a display option to visually break lines to fit in the display window width and does not affect the actual data.
    Saul

  8. #8
    Non-Member
    Join Date
    Jan 2004
    Location
    Seattle
    Posts
    4,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Then is there another way to get rid of line breaks?

  9. #9
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,350
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    yes, do a search and replace for hex 10 and hex 13 and replace them with a space
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •