Jump to content

Multiple lines displayed from mysql string.


elmas156

Recommended Posts

Hello everyone.  I'm creating a website that has a sort of messaging system built in and I'm trying to get the information pulled out of the database to display exactly as it was typed.  For example, if someone types this message:

 

"This is the first line.

This is the second line.

 

And this is two lines below the second line."

(By the way, when I view this message using phpMyAdmin, the message is displayed in the above format.)

 

I would like to have the message displayed the same way when it is queried from the database.  As of now, this is what I'm seeing instead:

 

"This is the first line. This is the second line. And this is two lines below the second line."

 

How can I achieve this?  I would post the code that I'm using, but it's just a basic mysql query to get a variable "$message" then I'm just using echo "$message"; to put it on the page.  Any help to point me in the right direction would be greatly appreciated.  Thanks!

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.