Storing text Data into database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
arunkar
Forum Commoner
Posts: 50
Joined: Mon Feb 25, 2008 10:37 pm

Storing text Data into database

Post by arunkar »

Hi,

Im haveing a text area where the user enters any text as below:

"DANA is the Pali word for generosity and is one of the most important Buddhist virtues. Dana is giving with generosity of spirit, without coveting or desiring any reward or recognition for our giving.

We have selected a few of our favorite charitable organizations' to inspire you to practice the tradition of Dana, including three exemplary local organizations in Lawrence, MA. Please take a moment to visit their websites or the websites of your favorite charities.

With Metta (lovingkindness),
The folks at DharmaCrafts"


the (organizations') apostophies are replaced with (organizations\') in the database

How Do I display the data as organizations' instead of organizations\' in my output...

thanks
adroit
Forum Commoner
Posts: 37
Joined: Fri Aug 08, 2008 1:25 am
Location: India
Contact:

Re: Storing text Data into database

Post by adroit »

Use stripslashes ($str) function.
arunkar
Forum Commoner
Posts: 50
Joined: Mon Feb 25, 2008 10:37 pm

Re: Storing text Data into database

Post by arunkar »

Thank you.

When I display the data the system throws every thing as one chunk. How do I display them whith the line brakes as they have entered the data into the database?

The field in the database does is like this
DANA is the Pali word for generosity and is one of the most important Buddhist virtues. Dana is giving with generosity of spirit, without coveting or desiring any reward or recognition for our giving.

We have selected a few of our favorite charitable organizations\' to inspire you to practice the tradition of Dana, including three exemplary local organizations in Lawrence, MA. Please take a moment to visit their websites or the websites of your favorite charities.

With Metta (lovingkindness),
The folks at DharmaCrafts
The PHP output is :
The future is not somewhere we are going. It is something we are creating. Every day we do things that make some futures more probable and others less likely. Global warming already disrupts millions of lives daily in the forms of destructive weather patterns and loss of habitat. What is already happening is only the tip of the melting iceberg, for it is our children and grandchildren who may suffer most from the effects of global warming. Hundreds of millions of people may be exposed to famine, water shortages, extreme weather conditions and a 20 - 30% loss of animal and plant species if we don\'t reduce the rate of global warming and reduce GHG emissions\'. This article outlines some ways that you can act to help prevent the Earth from warming further. While humankind has the ability to destroy the planet, we can also help protect and sustain it.
How do I display as in the database?

Thanks :)
arunkar
Forum Commoner
Posts: 50
Joined: Mon Feb 25, 2008 10:37 pm

Re: Storing text Data into database -- got it :) thnx

Post by arunkar »

thanks guys nl2br() did the trick..


:)
Post Reply