Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retrieving formatted text from mysql database

 
Shashank Anand
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a column of datatype 'text' in mysql table. I insert text using a textarea in a jsp page, like:

Hi this is Shashank.
Glad to meet you.

Bye.

When I retrieve the data, it comes out like 'Hi this is Shashank. Glad to meet you. Bye.' in a single line. Will anybody please guide me how I can maintain the text format that was put into the database and display it in the same format?

Thanks in advance.
Shashank


 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shashank,
There are two places where the formatting could be getting lost:

1) Between submitting it and storing it in the database
2) Between retrieving it and painting the page

Do you know which of the two is causing the problem. In any case, this is likely to be an HTML question rather than a database one so I'll move it to our HTML forum.
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All you said was "it comes out like...". You didn't say "When I displayed it in a text area it looked like..." so I'm guessing you didn't display it in a text area. So it would be useful to know what tool you WERE using when you displayed it.
 
Shashank Anand
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right.

So far I was trying to display the records from database in a html table. Now I retrieved it in a text area, the format was perfect. So that means the formatted text itself is saved in the database. Do you have any idea if the display is not in a text area, but simply in a paragraph like how to get the formatted text?

Regards,
Shashank
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic