thebopps5 Posted October 12, 2010 Share Posted October 12, 2010 I have a php app I am writing for our employees to write up the repairs they are doing. One of the fields in the tickets table is ticket_description (VARCHAR, length: 1000). They often skip to new paragraphs in the description, when explaining multiple items. When they submit the ticket, it is successfully inserted into the DB. When I look at the tickets in phpmyadmin, the formatting is correct, it includes carriage returns. When I output this field using php, it does not include the carriage returns, it is just the description all on one line. Any idea? Link to comment https://forums.phpfreaks.com/topic/215700-outputting-carriage-returns-from-mysql/ Share on other sites More sharing options...
Pikachu2000 Posted October 12, 2010 Share Posted October 12, 2010 nl2br() is what you'll need to convert the \n linebreaks to html <br> linebreaks. Link to comment https://forums.phpfreaks.com/topic/215700-outputting-carriage-returns-from-mysql/#findComment-1121468 Share on other sites More sharing options...
thebopps5 Posted October 12, 2010 Author Share Posted October 12, 2010 awesome, worked perfectly! thanks very much! Link to comment https://forums.phpfreaks.com/topic/215700-outputting-carriage-returns-from-mysql/#findComment-1121482 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.