How to save data directly to database after reading from a doc file

Hello,i am using PHP as a programming languageHello,i am using PHP as a programming language
and Mysql as database.and Mysql as database.
My task is to read the doc file at the time ofMy task is to read the doc file at the time of
uploading and read the contents and save themuploading and read the contents and save them
to database.to database.
I am able to upload the file and read the data andI am able to upload the file and read the data and
get all the contents in a variable but i am not ableget all the contents in a variable but i am not able
to save that data to  the databse because ofto save that data to  the databse because of
unwanted text or special characters added to theunwanted text or special characters added to the
string while reading it, because of formatting thatstring while reading it, because of formatting that
a world file have.a world file have.
So if any one help me out how to store that dataSo if any one help me out how to store that data
to database or how to maintain the formatting ofto database or how to maintain the formatting of
word file.i had tried no of things and expectedword file.i had tried no of things and expected
some good options so that i can solve thatsome good options so that i can solve that
problem.problem.
Please help me.your interest is highlyPlease help me.your interest is highly
appriciated.tons of thanks in advance.appriciated.tons of thanks in advance.