Skip to main content
Inspiring
May 5, 2006
Question

Display a text from a database with paragraphs

  • May 5, 2006
  • 1 reply
  • 250 views
Hi
I’ve just developed a php page that gets texts from a mysql database and displays them on the site, but my problem is that it doesn’t show the paragraphs I make.
The texts are uploaded to the database with a dreameaver form.

Can anyone help me?
This topic has been closed for replies.

1 reply

Inspiring
May 5, 2006
> Can anyone help me?

Paragraphs are HTML tags. You need to store the text in the DB as HTML.

Of course, to do that, you need to create HTML to put into the database.

The typical way is to use a 'textarea WYSIWYG editor replacement' like
Xstandard or TinyMCE.

This allows you to make HTML that can be saved in the DB.

Otherwise, if the ONLY html you need is P tags, you could take the text out
of the DB and manually go through the text replacing each double line-return
with </p><p> and then dumping the whole thing in between a set pf <p></p>
tags.

-Darrel