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 Quote Link to comment 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']); Quote Link to comment 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. Quote Link to comment 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 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.