Greetings again, members of the php technorati. How do I get form data to be saved in db with line breaks? I used wordwrap= virtual but it doesn't work! all lines are connected to each other in one continuous string! This is probably a noob issue but please enlighten me! I refuse to ask the user to add in <br> and <p>! Help me to help them make their form usage less complicated!
Thanks in advance,
Batoe
Html Wordwrap issue for mysql db!
Moderator: General Moderators
Re: Html Wordwrap issue for mysql db!
Use nl2br when you display the text. Not when you put it into the database.
Because it already has the line breaks. The issue is that HTML will automatically collapse spaces and line breaks into a single space (unless told otherwise with the white-space CSS... thing).
Because it already has the line breaks. The issue is that HTML will automatically collapse spaces and line breaks into a single space (unless told otherwise with the white-space CSS... thing).
Re: Html Wordwrap issue for mysql db!
Alternatively, you can use a free WYSIWYG editor like TinyMCE or my personal favourite; CKEditor. This will automatically format in the paragraph tags etc.cap2cap10 wrote:Greetings again, members of the php technorati. How do I get form data to be saved in db with line breaks? I used wordwrap= virtual but it doesn't work! all lines are connected to each other in one continuous string! This is probably a noob issue but please enlighten me! I refuse to ask the user to add in <br> and <p>! Help me to help them make their form usage less complicated!
Thanks in advance,
Batoe