MySql and Text Overflowing

Discussion in 'PHP' started by audax, Feb 1, 2007.

  1. #1
    Here's the problem I'm running into:
    I have a form that has a textarea field in it where the user can type out paragraphs and have them entered into the MySQL database. However, when I try to 'echo' those results back onto a page, they show up as one long line which makes it so that the user would have to scroll horizontally to read the paragraph. How can I have it enter the information into the database that will make it so that it is overflowed?

    I have it set to nl2br the data before it's entered, but it doesn't help if the paragraph(s) don't have any new lines in them.

    The textarea box wraps the text, but how can I get it to display the text wrapped like it was in the textarea box?
     
    audax, Feb 1, 2007 IP
  2. aplus

    aplus Well-Known Member

    Messages:
    83
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    115
    #2
    try this:

    
    <div style="width:150px"><?php echo $mytext;  ?></div>
    
    PHP:
    or you can echo your text within a <textarea></textarea>
     
    aplus, Feb 1, 2007 IP
  3. audax

    audax Peon

    Messages:
    83
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yea, I did put it in a div, but for some reason it stretches the div to fit the text, even when I gave it a specific width. I can't seem to get it to work.
     
    audax, Feb 1, 2007 IP
  4. aplus

    aplus Well-Known Member

    Messages:
    83
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    115
    #4
    After some googling i found:

    h*tp://www.blooberry.com/indexdot/css/properties/text/wordwrap.htm
    and
    h*tp://css-discuss.incutio.com/?page=WordWrapLongText

    i hope it helps
     
    aplus, Feb 1, 2007 IP
  5. audax

    audax Peon

    Messages:
    83
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Still no go :( The bug appears to be only in firefox and not IE.

    It appears that Firefox isn't capable of wrapping the text, but IE is:
    http://www.codingforums.com/showthread.php?t=72641

    Also, the error only occurs when words are copy + pasted into the textarea and not manually typed into it. Hmm.
     
    audax, Feb 1, 2007 IP