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

 

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.