hostfreak Posted September 6, 2006 Share Posted September 6, 2006 I am sure there is an easy answer to this, but it's something I have never needed to do/think about. I've made a simple news script to post small updates etc. I store the posted news in a text field in a database. So my problem is that when I am typing the news, say I hit enter a couple times to go down a couple lines or what not. When I echo the news from the field (news) everything is put together. The lines I entered are no longer there. Is there any way to enter the lines into the database? Quote Link to comment Share on other sites More sharing options...
AndyB Posted September 6, 2006 Share Posted September 6, 2006 Not sensibly. The solution is to use the nl2br() function when outputting the information:[code]echo nl2br($news_item);[/code] Quote Link to comment Share on other sites More sharing options...
hostfreak Posted September 6, 2006 Author Share Posted September 6, 2006 Thanks Andy, that worked. 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.