chriscloyd Posted November 20, 2006 Share Posted November 20, 2006 I have a form and i enter the info into a mysql database say this is the text i wrote[quote]Hi, how are you today?From Chris[/quote]but when i display it from the mysql db it shows up like[quote]Hi, how are you today?From Chris[/quote]how do i make it show up like [quote]Hi, how are you today?From Chris[/quote] Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted November 20, 2006 Share Posted November 20, 2006 use nl2br() http://php.net/nl2brso like this:[code]$message = nl2br($_POST['my_message']);$sql = mysql_query("INSERT INTO db_table(`message`)VALUES('$message')");[/code]Then when you display it:[code]$sql = mysql_query("SELECT * FROM db_table");$row = mysql_fetch_array($sql);echo $row['message'];[/code]Hope this helps 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.