justjay Posted January 10, 2007 Share Posted January 10, 2007 It has been a while since I have had the chance to do any work in PHP so there are a lot of cobwebs. I am not sure what exactly to call what I am trying to do so it has been hard to try and successfully search for any assistance.I have a field in my MySQL table that acts as a BIO about the people in the DB - the data in that TEXT field is displayed in paragraphs (no coding just raw text with line breaks).How do I used PHP to pull that data so when it is displayed on the web page it includes the line breaks?[b]EXAMPLE:[/b][b]Content of field in TABLE (text):[/b][quote]It has been a while since I have had the chance to do any work in PHP so there are a lot of cobwebs. I am not sure what exactly to call what I am trying to do so it has been hard to try and successfully search for any assistance.I have a field in my MySQL table that acts as a BIO about the people in the DB - the data in that TEXT field is displayed in paragraphs (no coding just raw text with line breaks).How do I used PHP to pull that data so when it is displayed on the web page it includes the line breaks?[/quote][b]Currently displaying like (using echo or print);[/b][quote]It has been a while since I have had the chance to do any work in PHP so there are a lot of cobwebs. I am not sure what exactly to call what I am trying to do so it has been hard to try and successfully search for any assistance. I have a field in my MySQL table that acts as a BIO about the people in the DB - the data in that TEXT field is displayed in paragraphs (no coding just raw text with line breaks). How do I used PHP to pull that data so when it is displayed on the web page it includes the line breaks?[/quote][b]Want it to look like:[/b][quote]It has been a while since I have had the chance to do any work in PHP so there are a lot of cobwebs. I am not sure what exactly to call what I am trying to do so it has been hard to try and successfully search for any assistance.I have a field in my MySQL table that acts as a BIO about the people in the DB - the data in that TEXT field is displayed in paragraphs (no coding just raw text with line breaks).How do I used PHP to pull that data so when it is displayed on the web page it includes the line breaks?[/quote]Hope someone can help me with this headache!Thanks,Jay Link to comment https://forums.phpfreaks.com/topic/33611-use-php-to-pull-data-from-text-in-mysql/ Share on other sites More sharing options...
trq Posted January 10, 2007 Share Posted January 10, 2007 Run your output through [url=http://php.net/nl2br]nl2br[/url]. Link to comment https://forums.phpfreaks.com/topic/33611-use-php-to-pull-data-from-text-in-mysql/#findComment-157464 Share on other sites More sharing options...
mkosmosports Posted January 10, 2007 Share Posted January 10, 2007 Just curious. Is there a reason why you dont want to have html in the BIO field (make it a blob type)? Link to comment https://forums.phpfreaks.com/topic/33611-use-php-to-pull-data-from-text-in-mysql/#findComment-157466 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.