grazzman Posted January 19, 2007 Share Posted January 19, 2007 So, This should be a simple one. I have a TextArea on a form. When you submit, it goes to a text field in the Mysql. When I echo the data, it looses all its formating... As in, if I have multiple lines it will echo it as one big line unless I put html code in to the textarea. Is their a way to fix this?Thanks Link to comment https://forums.phpfreaks.com/topic/34936-mysql-text-fields/ Share on other sites More sharing options...
simcoweb Posted January 19, 2007 Share Posted January 19, 2007 What mode is your field in the mysql database? Is the textarea field set as 'text'? Link to comment https://forums.phpfreaks.com/topic/34936-mysql-text-fields/#findComment-164749 Share on other sites More sharing options...
grazzman Posted January 20, 2007 Author Share Posted January 20, 2007 Yep,MyBio text latin1_swedish_ci NULLand the echo is just echo $user['MyBio'], form is just a textarea form field Link to comment https://forums.phpfreaks.com/topic/34936-mysql-text-fields/#findComment-164752 Share on other sites More sharing options...
effigy Posted January 20, 2007 Share Posted January 20, 2007 See the nl2br function. Link to comment https://forums.phpfreaks.com/topic/34936-mysql-text-fields/#findComment-164753 Share on other sites More sharing options...
simcoweb Posted January 20, 2007 Share Posted January 20, 2007 So I understand...you're echo'ing the text INTO a text area? So it's populating the text area form field as if someone was going to edit it? Like in a profile, for example? Link to comment https://forums.phpfreaks.com/topic/34936-mysql-text-fields/#findComment-164755 Share on other sites More sharing options...
grazzman Posted January 20, 2007 Author Share Posted January 20, 2007 yea, thenl2br($user['MyBio']) did the trick... Thanks again, I LOVE THIS FORUM. Link to comment https://forums.phpfreaks.com/topic/34936-mysql-text-fields/#findComment-164759 Share on other sites More sharing options...
simcoweb Posted January 20, 2007 Share Posted January 20, 2007 Yep, we learn something new everyday here :) Link to comment https://forums.phpfreaks.com/topic/34936-mysql-text-fields/#findComment-164762 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.