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] Link to comment https://forums.phpfreaks.com/topic/27845-htmlentities/ 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 Link to comment https://forums.phpfreaks.com/topic/27845-htmlentities/#findComment-127375 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.