[PHP] Formatted text from mySQL DB

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Re: [PHP] Formatted text from mySQL DB

    From: "PHPSpooky" <phpspooky@mjimm.com>
    > When I create any field and let data be sent into my mySQL DB through
    > it.. it goes ok. But when I retrieve it.. the data comes completely
    > unformatted.
    Ah, this question again. Has it been four days already?

    HTML does not render new lines. Have a look at the source code of your page
    and you'll see that the text is indeed on separate lines. HTML only
    understands something like <br />, though, to go to a new line. So, you need
    to replace the new line characters with HTML breaks in order to maintain
    appearance.

    [url]www.php.net/nl2br[/url]

    ---John Holmes...

    Cpt John W. Holmes Guest

  2. Similar Questions and Discussions

    1. importing formatted text
      OK... how long has this been... but i found something. You can actually use Dreamweaver to Edit your content in HTML, then use the following...
    2. How do you store formatted text to be displayed!
      Hi please can someone help. Im developing a dynamic website and all is well, but i want to be able to store all the text somehow on the database,...
    3. Formatted text input
      My site has a very basic admin area, with text boxes in a form to add data to the database. However, I have to enter the text with all the html...
    4. Formatted text select tool gone in 6.0 pro
      Hi, What happened to the Table/Formatted Text Select Tool ???? This was available in 5.0 but gone in 6.0. Has this been replaced or simply...
    5. Paste Formatted Text
      This has been driving me crazy: I have started a database of interesting articles I have found onlne to read at a later time. A lot of the...
  3. #2

    Default RE: [PHP] Formatted text from mySQL DB

    > [snip]
    > Ah, this question again. Has it been four days already?
    > [/snip]
    >
    > ROFLMFAO!!!!! I snorted coffee through my nose!!! :)
    Ewwwwwwwwww!!!! I do not like coffee in my mouth.. but nostrils! Yuck!

    PHPSpooky



    Phpspooky Guest

  4. #3

    Default RE: [PHP] Formatted text from mySQL DB

    Astrum Et Securis!

    Thanks all.. for the very needed input.

    [url]www.php.net/nl2br[/url] has been very helpful. I'm still testing out the
    different ways. There appears to be a differentiation between people's
    usage and formulas for the same. While some find nl2br() very helpful,
    others find it a waste of time. And some have their own ereg_replace()
    formulas assisting them.

    A little bit of testing will have me on my way.

    Thanks again..

    Dominor!
    PHPSpooky


    > HTML does not render new lines. Have a look at the source code of your
    > page
    > and you'll see that the text is indeed on separate lines. HTML only
    > understands something like <br />, though, to go to a new line. So,
    you
    > need
    > to replace the new line characters with HTML breaks in order to
    maintain
    > appearance.
    >
    >
    Phpspooky Guest

  5. #4

    Default RE: [PHP] Formatted text from mySQL DB [nl2br]

    Astrum!

    $wow = nl2br($myrow[data]);
    echo $wow;

    works excellect for me!!

    Thanks!!

    Dominor. .
    PHPSpooky

    Phpspooky Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139