Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Problems With Data Formatting
masugidsk8r
post Mar 4 2007, 03:24 AM
Post #1


Premium Member
********

Group: Members
Posts: 168
Joined: 21-February 07
Member No.: 38,999



I have a MySQL database which stores articles. A sample article would look like this:

CODE
This is a body. This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.

This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.This is a body.


That's how it's displayed in the MySQL Database. Currently the data type is "TEXT". But when I load it on a php page to display that same article, it would show the same data but wouldn't have separate paragraphs. How would I be able to display the text in separate paragraphs?
Go to the top of the page
 
+Quote Post
jlhaslip
post Mar 4 2007, 03:54 AM
Post #2


A computer once beat me at chess, but it was no match for me at kick boxing.
Group Icon

Group: [MODERATOR]
Posts: 4,079
Joined: 24-July 05
From: Linix, DOS and Windows…the good, the bad and the ugly
Member No.: 9,787
Spam Patrol



On the php.net site, search for htmlentities() and nl2br(), the functions which converts potentially dangerous and damaging code tags from their 'regular' form into a format which is not dangerous nor damaging and there are others I am sure . Finding these functions and following the links in those descripptions will lead you to other functions to use, too.
The original data contains internal characters for tabs, carriage returns, new lines, etc, so the data needs to be altered from its source, to some thing safe. Use functions like these to do the cleansing. Then, when you remove the data from the database and proceed to print it or display it, the product looks the same as when it went in.

http://www.php.net
Go to the top of the page
 
+Quote Post
masugidsk8r
post Mar 4 2007, 04:08 AM
Post #3


Premium Member
********

Group: Members
Posts: 168
Joined: 21-February 07
Member No.: 38,999



Thx man, that really worked.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. How To Redirct Post Data ?(4)
  2. Help Importing Mysql Database Results(3)
  3. Php And Gd Tutorial(6)
  4. Postnuke Install Problems On Subdomains(1)
  5. Browser Problems, Maybe?(6)
  6. Form To Pdf, With Email?(3)
  7. <? Include ?> Problems(4)
  8. Help With Reading Files(5)
  9. Listing From Table Row Data(5)
  10. Finding Data In Meta Tags(0)
  11. Problems With Php Form?(7)
  12. Include Funtion Php Problems(11)
  13. Same 1 Registeration Data For Different Purposes(4)
  14. Major Problems With Php Script(8)
  15. Loading Mysql Data Into A Table(10)
  1. Phpnuke Newsletter Sending Problems(0)
  2. Odbc Form Problems(0)
  3. String/text Formatting?(4)
  4. Mysql Authentication Problems(11)
  5. Preg_replace Problems(7)
  6. How Good Is This Data Cleaning Function?(2)
  7. Problems With Php(5)
  8. Putting Data Of 2 Pages In Mysql At Once(1)
  9. What Does This Do?(4)
  10. Php Problems(3)
  11. Using Multiple Selection Array In Table To Order Data(1)
  12. Php Email Validation(1)
  13. Php + Mysql Question!(4)


 



- Lo-Fi Version Time is now: 12th October 2008 - 07:18 AM