Jump to content

[SOLVED] Keep Paragraphs


gilespatrickson

Recommended Posts

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!

 

Link to comment
https://forums.phpfreaks.com/topic/137451-solved-keep-paragraphs/
Share on other sites

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'];

 

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.