rrsriram Posted May 29, 2008 Share Posted May 29, 2008 Dear Friends, I am trying PHP for the first time and i have a problem which needs to be solved urgently. I am inserting into a MySql text field the following data "Height: 100 mm Width: 200 mm Length: 300mm Color: White/Brown/Red" In the database it is properly stored and when i test it at http://localhost it is displaying properly. But when it is hosted on a site, the same display comes in as a single line like below. "Height: 100 mmWidth: 200 mmLength: 300mmColor: White/Brown/Red" and the formating is totally gone. Would appreciate if someone can help me on this and get the formatting proper. PLEASE HELP. Best Regards, R.R.Sriram Link to comment https://forums.phpfreaks.com/topic/107864-solved-need-help-urgently/ Share on other sites More sharing options...
pocobueno1388 Posted May 29, 2008 Share Posted May 29, 2008 Try using the function nl2br() when displaying the data from the database. echo nl2br($row['db_row']); Link to comment https://forums.phpfreaks.com/topic/107864-solved-need-help-urgently/#findComment-552899 Share on other sites More sharing options...
rrsriram Posted May 29, 2008 Author Share Posted May 29, 2008 Thanks for the prompt reply. Will try and update if it worked for me. Thanks again for the prompt help. Link to comment https://forums.phpfreaks.com/topic/107864-solved-need-help-urgently/#findComment-552902 Share on other sites More sharing options...
rrsriram Posted May 29, 2008 Author Share Posted May 29, 2008 Dear pocobueno1388, Thank you for the help. Works like a charm. Regards, R.R.Sriram Link to comment https://forums.phpfreaks.com/topic/107864-solved-need-help-urgently/#findComment-552955 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.