brem13 Posted March 31, 2009 Share Posted March 31, 2009 i got a simple blog page on my site and if someone enters a blog and they write it in this format... hey, this is a blog. it will all show up properly in the database when i look at it, but when its called back to be viewed on the page, it shows up like this hey,thisisablog. here is the code i use to call it back... mysql_connect($server, $db_user, $db_pass) or die (mysql_error()); $result = mysql_db_query($database, "select * from $table WHERE id = '$id'") or die (mysql_error()); while ($qry = mysql_fetch_array($result)) { echo '<font face=tahoma size=2><strong>'; echo $qry[name]; echo '</strong><br><hr align=left width=200px>'; echo $qry[message]; echo '</font><br><br>'; echo '<font face=tahoma size=1><strong>Date Created:</strong> '.$qry[date_created].' - <strong>Date Modified:</strong> '.$qry[date_modified]; Quote Link to comment Share on other sites More sharing options...
Ayon Posted March 31, 2009 Share Posted March 31, 2009 try this str_replace("\n","<br />\n",$qry[message]); Quote Link to comment Share on other sites More sharing options...
lonewolf217 Posted March 31, 2009 Share Posted March 31, 2009 i believe the function nl2br() will work for this to display properly Quote Link to comment Share on other sites More sharing options...
brem13 Posted March 31, 2009 Author Share Posted March 31, 2009 thank you very much 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.