Jump to content


Defining a path to a folder on server in a db field

  • Please log in to reply
No replies to this topic

#1 swatisonee

  • Members
  • PipPipPip
  • Advanced Member
  • 253 posts

Posted 31 July 2006 - 06:41 AM



I'm having a hard time trying to figure out a simple way to do this. Would really be glad of any advise . Thanks . Swati

a. I have a db with some 70 odd tables.

b. 4-5 of the tables are Reports which include fields with text data - that run into several pages , so i define those fields as long text. This is getting unmanageable now

c. I would like to define the field where the text data is such that it points to a path on the server where i have created a folder where word files can be stored.

d. Basically, i would like to convert all the data in a text field into a word file and each time the record is called, the word file will also open up for updation. So the fields in the scripts below for problem, work done, status would all come in a single word document that would be stored in a folder say $file_dir="service/";

e. Thereafter, i would like to be able to both view and email the entire document as and when required.

f. How do i define the path for these text fields in the UPDATE statement that i currently use below ?  I need to indicate that the text represented by $status for example, resides in a document on a folder on the server and not in the database . If $status has to be something like \service\userid\company.doc then will `Status` = ' \service\userid\company.doc ' in the foll UPDATE Statement ? If i replace $status below with ' \service\userid\company.doc ' , I get an error.

$sql = "UPDATE `Services` SET `Productid`='$id', `Company`='$customer', `BusinessCity`='$biz_city',  `LastName`='$last_name',`ServiceRequestDate`='$ireq_date',`ServiceDate`='$Service_date', `Model`='$model', `Specs`='$specs', `SerialNumber`='$serial_number',`Type`='$type',`ProblemReported`='$prob_reported',`WorkDone`='$work_done',`AuthorisedBy`='$authorised_by', `Status`='$status' WHERE `Serviceid`='$Serviceid' "; 

$result1 = mysql_query($sql) 
    or die (mysql_error() );


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users