garethhall Posted June 23, 2009 Share Posted June 23, 2009 Hi Gurus, I would like to know how to display mysql data and format it automatically. Here is what I mean. I have an address in a single field in the DB. When I look at that data in Sequel Pro, Navicat or phpMyAdmin. I displays it as multiple lines like it's adding the <br> tag all by it self. But when I out put that record / field then I get it all in one line. Why is that and how can I fix it? Quote Link to comment https://forums.phpfreaks.com/topic/163336-solved-displaying-mysql-datawith-automatic/ Share on other sites More sharing options...
JasonLewis Posted June 23, 2009 Share Posted June 23, 2009 Check out nl2br. Simply put the data in a variable then use nl2br() on it to convert new line characters to HTML line breaks. Quote Link to comment https://forums.phpfreaks.com/topic/163336-solved-displaying-mysql-datawith-automatic/#findComment-861782 Share on other sites More sharing options...
garethhall Posted June 23, 2009 Author Share Posted June 23, 2009 Thank you work Fantastic Quote Link to comment https://forums.phpfreaks.com/topic/163336-solved-displaying-mysql-datawith-automatic/#findComment-861786 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.