SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    Froot r gewd SubKamran's Avatar
    Join Date
    May 2002
    Location
    North Star State
    Posts
    597
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Does mySQL preserve line breaks?

    Cuz I'm converting from Access to mySQL, and in Access, it doesn't preserve them...does mySQL?

    just a simple question...I have the code...
    "Sometimes little is more."
    Kamran A
    Web Dev/Designer
    Keyboard not found: Please Press F1 to Continue

  2. #2
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As in \n \r and \r\n? Yep it does

    Moved to a more appropriate forum

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  3. #3
    Froot r gewd SubKamran's Avatar
    Join Date
    May 2002
    Location
    North Star State
    Posts
    597
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    er. I mean directly from a textarea when added into a field...that would be 'CHR(10)' in ASP...
    "Sometimes little is more."
    Kamran A
    Web Dev/Designer
    Keyboard not found: Please Press F1 to Continue

  4. #4
    SitePoint Zealot JEmLAC's Avatar
    Join Date
    Apr 2002
    Location
    Kansas City
    Posts
    156
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Does mySQL preserve line breaks?

    Originally posted by SubKamran
    Cuz I'm converting from Access to mySQL, and in Access, it doesn't preserve them
    I know this isn't exactly what your original question was asking, but an Access database does preserve line breaks. When I create a table and hang a form off it, from within Access, I have to set the field to accept enter key as a new line and when I edit the field directly on the table I have to do ctrl-Enter to put a line break.

    I did a simple HTML form submitting to an ASP that connected to an Access database and passed a textarea value that had multiple line breaks. The string passed to the ASP and the insert query on the ASP put the string, line breaks and all, into the Access table. I looked at the Access table and the line breaks are there. Are you sure your Access database isn't capturing the line breaks? You may have to adjust the field height of your table to see the extra lines.

    B
    Morning person by habit, not by nature.


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
  •