hey all~!
I wish to insert comments inside a mysql database column which is a varchar(255) type. I'm not sure where to look to solve my problem, I even tried using some modules like Text::Wrap, but that doens't help much with this.
My problem is not when I insert a comment. For example, if the comment typed out on the textarea field looks like this:
This is a sample comment being inserted into a MySQL DB. I would like
+ to format things correctly when being edited.
This is the 2nd "paragraph", or sentence after the line above this one
+.
Now when I insert it, the format is fine. But lets say I try to edit this comment, and I add the word "Hello" at the very end, then the comment will look like this:
This is a sample comment being inserted into a MySQL DB. I would like
+ to format things correctly when being edited.
This is the 2nd "paragraph", or sentence after the line above this one
+. Hello
Notice how it adds two whole new line breaks between the first one? How do I remove that extra space? What is causing it too add those new lines?
I want to allow new lines to indicate a new paragraph, so I don't want to do a regex that removes all \n's ?
Is there anyway I can solve this with a perl regex?
thank you!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.