penguinin thedark Posted December 15, 2008 Share Posted December 15, 2008 MySQL version 3.23.58 Dearest MySQL experts, I have created a program to edit a database entry using PHP and MySQL. The MySQL text content (for example) is: "Lorem ipsum dolor sit amor et ibam forte via sacra sicut meus est mos, nescio quid meditans nugarum totus in illis. Accurrit quidam notus mihi nomine tantum, arreptaque manu, quid agis, dulcissime rerum?" *Notice the paragraph break. When I pull this entry onto the webpage for viewing using PHP ( but not to edit) it outputs: "Lorem ipsum dolor sit amor et ibam forte via sacra sicut meus est mos, nescio quid meditans nugarum totus in illis. Accurrit quidam notus mihi nomine tantum, arreptaque manu, quid agis, dulcissime rerum?" *Notice no paragraph break. When I select Edit so that the text comes straight from MySQL into a textarea for editing, it shows up as: [begin textarea box] "Lorem ipsum dolor sit amor et ibam forte via sacra sicut meus est mos, nescio quid meditans nugarum totus in illis. Accurrit quidam notus mihi nomine tantum, arreptaque manu, quid agis, dulcissime rerum?" [End textarea box] *Notice that the paragraph break is in place. I have tried a replace of \r\n and \r\n\r\n (with appropriate pre-backslashes) with <p> for the html (no edit) output straight from MySQL, but it doesn't seem to work. It appears those symbols do not exist coming out of MySQL. But after the text has been pulling into a textarea for editting, when I do the replace of \r\n\r\n with <p>, it works out fine when I refeed the content to the same webpage. What are the symbols for the paragraph and newline breaks coming out of MySQL, if they aren't \r\n, etc.? Humbly Yours, Chris Quote Link to comment Share on other sites More sharing options...
Mchl Posted December 15, 2008 Share Posted December 15, 2008 Before we do anything here... Why MySQL 3.x ? Use nl2br Quote Link to comment Share on other sites More sharing options...
penguinin thedark Posted December 15, 2008 Author Share Posted December 15, 2008 Which MySQL version would you recommend? Quote Link to comment Share on other sites More sharing options...
Mchl Posted December 15, 2008 Share Posted December 15, 2008 5.1.30 (or simply said: latest generally available) 4.0 will not be supported at all (not even bugfixes) by MySQL AB as of 31 Dec 2008. 4.1 will share its fate 31 Dec 2009 ... Just think how old 3.x is... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.