If anyone can give me the solution to this, I'd greatly appreciate it:
I have a form that adds a row to a MySQL table, and then I echo that row on a page. One of the things in the form is a text field, where I'm planning to insert long articles with several paragraphs.
The issue is that if I simply press the "Enter" key on the keyboard to make line breaks in the text area, the MySQL doesn't recognize it as a line break, and thus echoes the entire article as one long paragraph.
How can I make it recognize line breaks?
Thanks in advance for any help.
Automatic breaks in MySQL data?
Started by greg, Dec 01 2006 11:03 PM
3 replies to this topic
#1
Posted 01 December 2006 - 11:03 PM
#2
Posted 01 December 2006 - 11:19 PM
Ugh, should've spent a little more time searching before asking. I found the solution: http://zulumonkey.org/?id=tutorials&pa...ment&oid=36
Well, hopefully this'll be useful to someone else who's been wondering the same thing.
Well, hopefully this'll be useful to someone else who's been wondering the same thing.
#3
Posted 02 December 2006 - 12:26 AM
Intergrate a editor eg tinymce or FCKeditor
That should work!
#4
Posted 02 December 2006 - 01:55 AM
Considering it's the fact that all mySQL sees and stores exactly what you tell it to, it's not that it doesn't recognize the "enter" key, it's that the enter key sends a newline "\n" character. So if you viewed the source, the breaks would be there, but html ignores whitespace unless you use a <pre> tag, or use css - white-space:pre; There is also the uber-simple php str_replace("\n", '<br>', $text);
In short, using FCKeditor would be a huge waste of time and bandwidth unless he's planning on going full WYSIWYG on this textarea.
And this topic was technically solved, so both of these last two posts were pretty pointless
In short, using FCKeditor would be a huge waste of time and bandwidth unless he's planning on going full WYSIWYG on this textarea.
And this topic was technically solved, so both of these last two posts were pretty pointless
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
