gilespatrickson Posted December 17, 2008 Share Posted December 17, 2008 Hello. I am uploading text data into my mysql database with no problems. I am returning it and displaying it on my webpage. The only issue that I am having is that I am losing my paragraphs. I have two questions. 1. How do I return my data and retain my paragraphs? 2. Does it mater if you copy and past content that contains several paragraphs in the input textarea field? Thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/137451-solved-keep-paragraphs/ Share on other sites More sharing options...
premiso Posted December 17, 2008 Share Posted December 17, 2008 Wow this is like the 3rd or 4th topic today on this subject.... http://www.phpfreaks.com/forums/index.php/topic,230496.0.html Is the most recent, only like 5 posts down from this one. Quote Link to comment https://forums.phpfreaks.com/topic/137451-solved-keep-paragraphs/#findComment-718281 Share on other sites More sharing options...
gilespatrickson Posted December 18, 2008 Author Share Posted December 18, 2008 I have tried several different methods. Here is the code that I have now. It prints the data but there are no parapgraphs. I know that I douple spaced when I input the data. Could I have insert the data in a way that did not include the spaces? <?php echo "<br /><br /><br />"; $file = mysql_query("SELECT * FROM content WHERE cont_id = '9'") or die(mysql_error()); $data = mysql_fetch_array($file); print $data['cont_title']; echo "<br /><br />"; $test = mysql_real_escape_string($data['cont_body']); print $test; print "<br /><br />"; echo "Document Source: " . $data['cont_source']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/137451-solved-keep-paragraphs/#findComment-718393 Share on other sites More sharing options...
genericnumber1 Posted December 18, 2008 Share Posted December 18, 2008 Read the first reply to the comment he linked you. Quote Link to comment https://forums.phpfreaks.com/topic/137451-solved-keep-paragraphs/#findComment-718399 Share on other sites More sharing options...
gilespatrickson Posted December 18, 2008 Author Share Posted December 18, 2008 Like a charm! Thanks for the help! Quote Link to comment https://forums.phpfreaks.com/topic/137451-solved-keep-paragraphs/#findComment-718415 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.