Forum Moderators: coopster

Message Too Old, No Replies

show text from mysql by paragraph

insert and query from mysql

         

sajjat

1:36 pm on Feb 11, 2006 (gmt 0)

10+ Year Member



dear all:

i am trying to develop a site for news paper. i keep articles in a longtext field in Mysql. But when a retrieve the data from database. i lose all paragraphs. the total article in shown in one paragraph.

But i want them be as it is the way i paste them. Pls help to do find out the solutions. Thank you.

henry0

1:41 pm on Feb 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I do not get it
if you post in PHP we should think that you have at least a good HTML knowledge.
So unless I do not understand your problem
why do not you first format the text with <p> <br> etc..
or simply hook a text editor to your form of CMS?

Keep us posted.

arran

1:52 pm on Feb 11, 2006 (gmt 0)

10+ Year Member



You either need to embed html in your database or alter the schema to allow the notion of paragraphs then stitch them together using php.

e.g.


document (documentID, paragraphID, paragraphText)

select paragraphID, paragraphText from document where documentID = <id>;

arran.

sajjat

1:58 pm on Feb 11, 2006 (gmt 0)

10+ Year Member



thanks... for ur comment.

i tired for last 2 days. nothing happened.. but just after post. i solved it.

i used htmlspecialchars() function. so it was not working.

thank you again.

sajjat