Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Can I Convert MySQL Db Records Into Microsoft Word Documents?


i found the solution to export
file from mysql db into *.csv. but is there anyway to convert the
contents into *.doc and save in my webserver and providing a link for
the end users to download the word file?

FYI, the database records are obtained by end users submitting the
forms themselve and i saved it in my db...




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Reading Microsoft Office Documents?
I need to be able to upload a Microsoft office document and then show the contents to the visitor, in addition i need to be able to  write documents on the fly.

Is there a way of doing this, or will i have to spend days researching and programming my own classes to handle it?

MS Word Documents
I've been asked to write a script to upload Microsoft Word documents and then convert them into 'printer friendly' pages. The uploading part I've got no problem with, but I can't find anything about reading MS word docs into PHP. Does anyone know anything about this?

I hope it's not as difficult as excel documents - which I'm still trying to get working on and off without any real success.

Word (or Other Documents) To PDF On The Fly?
Is there an option to convert any (or mosts file types) a user might upload to PDF format upon upload? I'd like users to be able to upload Word, Excel, Text and other documents, then have our upload script convert the document to PDF on the fly. Then viewing users would simply need the acrobat reader to view files, not all these other office products. Is this possible with just PHP and pdflib for example? If not, what are the options?

PHP And Microsoft Word
I have users who can sent a Word document as an attachment to an email
from a Microsoft-rich environment. I would like to be able to
"capture" that attachment as a blob and deposit it into a mysql
database. I am not sure how to do the capture.

Compare Two Word Documents Using Php
In my system I want to compare two word documents ,but my server is a
Linux one and thats y I cant create COM object .

Any othermethods to find this one .I think to connect PHP to some
other mightt be useful for this.....

Microsoft Word Formatter
Anyone know of some sort of php script that can read and format Microsoft word documents?

Extract Text From Word Documents
Is there a way to extract the text of a word document with php? And perhaps some of the formatting (like break lines, bold, italic,...)?

How To Embed Microsoft Word In A Page Using Php
how to embed or open microsoft word file in a page using php script

Html To Word Convert With Php
Html to word convert with php. Is there any one to help to convert a html php document to convert by doc(Word file).

Convert Word To HTML
How to convert MS Word 2003 file to HTML using php script?

Read File MS Word, Convert File Txt To MS WORD,
1. how can i read file and content from MS WORD file..
2. how i can create or convert to MS WORD file with php..

Convert Word-to-Text On Linux
How can I read a Word document and convert it to text (just in memory
is fine) on a Linux machine where there is no Word installed?

Convert MS Word / Rtf / ... To Plain Text
i'm looking for standalone libraries that convert documents to plain text so i can let people edit the text in a textarea after uploading. One thing to notice is that i can not use COM because i can't configure the webserver.

Does anyone has interesting classes that are able to do this. I found a PHP class for ms word documents at http://obninsk.name/obninsk_doc/ but that doesn't work at all for my word documents.

SQL Error: [Microsoft][ODBC Microsoft Access Driver] Too Few Parameters
I'm trying to execute the following SQL statement and get the following error.

SELECT DomainNames.DomainName FROM DomainNames WHERE DomainNames.DomainName Like "*ab*" ORDER BY DomainNames.DomainName

SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1., SQL state 07001 in SQLExecDirect

I'm running PHP4, Apache 1.3.12 (Win32) and connecting to an Access database on a Win2K box.

Odbc_exec(): SQL Error: [Microsoft][ODBC Microsoft Access Driver]
i am trying to write to the database through odbc. i get the following error:

Warning: odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query., SQL state S1000 in SQLExecDirect in c:inetpubwwwroot514VIP_SurveyProcess.php on line 41

my directory has read/write permissions why am i getting this? here is the code as an example:
...
$x = 10;
$querySet = "UPDATE Survey SET $rdoOption = $x";
odbc_exec($objConn, $querySet);
...

How To Upload Documents In Mysql
I'm a beginner and will like to know how to upload documents in mysql. These documents will be cited on the intranet and a user will have to search for a particular document using either date, title etc.

PHP/MySQL Records Per Row
Is there any way to have the records pulled from a mysql database display like this in a table:

record1 | record2
record3 | record4

etc: I've been thinking about this for about three months and have yet to come to a good solution.

How Do You Delete Records From Mysql
Could someone please show me how to delete records from mysql. Maybe even an example in a loop that deletes records based on a criteria.

How Many Records Can MYSQL 4.1.14 NT Via TCP/IP Can Hold?
how many records can MYSQL 4.1.14 NT via TCP/IP can hold?

how many records per table can MYSQL 4.1.14 NT via TCP/IP can hold?

how many records in a table can MYSQL 4.1.14 NT via TCP/IP can hold given the table has a field Primary key - BIGINT(20) autoincrement?

need your opinion..Here are the facts:

MY system is an internal one. My Server--Is only a Desktop.. Celeron 2.8 Gigahertz, 40Gig Baracuda HD, 512 MB memory.. And it serves an average of 20 users a day and it also serves me for my system development..The average records inserted per month on mYSQL is 10,000 records..We foresee that system would be used for about 10 years.

Counting Records In MySQL
I've been trying to write a page that checks the database and counts the number of records and if the number is less than 3000, it loads page X, but if the number is equal to 3000, it loads page Y.

I know this should be a simple if/else statement but it's the checking and counting that I cannot get to work. 

Putting A Word Doc In A Mysql Db?
This one has been bugging me for months everytime i've tried i've had
to give up and do something else. Anyone know how to do this, any help
would be much appreciated.

I think that I need to use a blob field is that correct?

How Do Iterate Through MySQL Records And Displat Them?
Basically I have a page where a person can choose from a list of stories posted by people, or they can choose to submit their own. I've managed to do the page where they can submit their on. The way i did this was to set up a mySQL database, and table in the database called stories. I then made an id (primary key), author, title, body and date field in the table. When the user submits their story its given an id (which increments on each submition) and their author, title and body fileds are sent to the database. The date key is automatically stamped in.

Ive also managed to have the submition page display what they submitted by using the count(*) function, their story would be the last to be submited , so it pulls that from the database and displays it.

Now what I want to do - on the page where they can pick a story, is have the page connect to the database and grab each record and display the author and title on the page next to a radio button. And have the id for the story in a hidden field or variable so when the user to chooses a particlar story it uses the id to grab the story from the database.

So how do iterate through all the records in the database, and display each one?

Problems Updating Records In MySQL With PHP
Sorry to ask what is probably a simple answer, but I am having problems
updating a table/database from a PHP/

PHTML file. I can Read From the Table, I can Insert into Table/Database, But
not update. Here is a copy of the

script I am using. I do not know what version of MySQL my host is running
nor do I have Shell Access to it. I

would like to setup a script so my website users can update thier records
without my intervention.

Also you may send replies to stevennyoung@yahoo.com

Begin Script

<?php
$db = mysql_connect("localhost", "username", "password");
mysql_select_db("databasename",$db);

if ($id) {
if ($submit) {
$sql = "UPDATE tablename SET
EMail='$EMail',Username='$Username',Password='$Pas sword',Item=

'$Item',Price='$Price',URL='$URL' WHERE Username='$Username'";
$result = mysql_query($sql);
echo "table Updated.";
} else {
// query the DB
$sql = "SELECT * FROM tablename WHERE Username='$Username'";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
?>
<form method="post" action="<?php echo $PHP_SELF?>">
e-Mail Address:<input type="Text" name="EMail" value="<?php echo
$myrow["EMail"] ?>"><br>
Username:<input type="Text" name="Username" value="<?php echo
$myrow["Username"] ?>"><br>
Password:<input type="Text" name="Password" value="<?php echo
$myrow["Password"] ?>"><br>
Item:<input type="Text" name="Item" value="<?php echo $myrow["Item"]
?>"><br>
Price:<input type="Text" name="Price" value="<?php echo $myrow["Price"]
?>"><br>
Item URL:<input type="Text" name="URL" value="<?php echo $myrow["URL"]
?>"><br>
<input type="Submit" name="Update" value="Update table">
</form>
<?php
}
} else {
// display list of articles
$result = mysql_query("SELECT * FROM tablename",$db);
while ($myrow = mysql_fetch_array($result)) {
printf("<a href="%s?Username=%s">%s %s</a><br>
", $PHP_SELF,
$myrow["Username"], $myrow["Item"], $myrow

["URL"]);
}
}
// Close DB Connection
mysql_close()
?>

Grabbing Specific MySQL Records
I have set up a target page to pull information out of a mySQL database to populate the page. The problem is that it is only pulling from the first record and not the record specified. What do I have to do to pull from a specific record? I am using Dreamweaver MX to administer the site on WinXP using PHP if that information will help.

PHP Mysql Outputting Records Repeatedly.
I have not messed with php/mysql in a while and have come up with a
problem I have run up against before but cannot remember the solution.
See the following page:

Need To Convert Mysql To Excel?
I need to display data from MySQL to Excel format. I looked at several excel classes, but they are missing three things that I need.

1. To be able to output a cell larger than 255 characters.
2. Be able to keep line breaks in cells.
3. be able to format the cell widths

I am currently using a tab delimited set up with excel http headers, but I can not format the cell widths.

Convert Access To Mysql Php?
does anyone know how to convert an access db into mysql db using php?

Convert MySQL Results To XML
I just got Dreamweaver CS3, and I love the built in SPRY framework. It allows you to create web applications that use a table listing, and details listing very quickly. Unfortunately the only data the SPRY framework can accept is XML. Is there a built in function to convert from a $row result from MySQL to XML? Code:

What Is The Preg For Capitals In A Word To Be Replaced By That Word Preceded By A Space
what is the preg for capitals in a word to be replaced by that word
preceded by a space?

i need to be able to do this in preg:

thisWord := this Word
AnotherExample := Another Example

strings with capitals sorrounded by other chars need to have a space
inserted before the capital.

Very Slow MySQL SELECT Query After 11 Records
I have a very weird problem

I moved my database to new IIS 6.0 + PHP 4.3 + MySQL 4.0 setup. I tried to check with myphpadmin if everything works fine, but I couldn't browse my table (125 records). I used SELECT option and found out that SELECT query up to 11 records is ok, but after that, even if I choose to limit query to 12 records, it just hangs.
I tried selecting from the beginning of the table and from the middle - same thing, but when I run query localy on mysql console, everything works fine

How Do I Prevent Mysql From Printing Redundant Records?
I have a very urgent question. I am using php and mysql.
Say I have a database full of names and email addresses. I want to do a query that when you type in the name or partial name, mysql will only show a name once, even if it is in the database 200 times. Then I want to click on that name and have mysql show the 200 email addresses associated with that name (which I know how to do). See below:

Inserting Master-detail Records In Mysql
how I can insert a master-detail record in mysql? I use an auto-increment key, but I don't know how I can find that key for inserting the detail records, I tried to make a 'highest-key' function with 'select MAX(field)...' but in php it gives the wrong key (in mysql it gives the right one).

Changing Data In Objectified Mysql Records
I am using this very slightly modified function found here:
http://us2.php.net/mysql_fetch_object
to make mySQL rows into objects of type $classname:

// This takes db result rows and makes real objects of $classname type
function &buildObj($result, $classname) {
while($row = mysql_fetch_assoc($result)) {
if ($row === null) return null;

/* Create the object */
$obj =& new $classname;

/* Explode the array and set the objects's instance data */
foreach($row as $key => $value)
{
$obj->{$key} = $value;
}
$objs[] = $obj;
}
return $objs;
}

This is called by a retrieve: function:

function retrieve($where) {
echo $query = "SELECT * FROM $this->table WHERE " . join(' AND ',
$where);
$result = mysql_query($query);
$rows =& buildObj($result, get_class($this));
mysql_free_result($result);
return $rows;
}

The problem I am encountering is that if I do this in my script:

$listing = new Listing;
$listings = $listing->retrieve(array('row > 1') );
foreach ($listing as $aListing) {
$aListing->address='xxxxxxxxxxxxx'
}
foreach ($listing as $aListing) {
print_r($aListing);
}

The value in $aListing->address is unchanged.

However if I do this:

$listing = new Listing;
$listings = $listing->retrieve(array('row > 1') );
foreach ($listing as $aListing) {
$aListing->address='xxxxxxxxxxxxx'
$newArray[] = $aListing;
}
foreach ($newArray as $aListing) {
print_r($aListing);
}

I see the update values in $aListing->address .

Break MySQL Records Into CSS Columns Automatically
I'm making a page of links, each assigned a category. There are two tables - "favourites_links" and "favourites_categories". This is how the links currently appear:

Category 1 Name
Link 1
Link 2
Link 3

Category 2 Name
Link 1
Link 2
Link 3

What I want to do is break my page into columns. Basically, set a number of columns (e.g. 3), count the total records, and work out how many records to show per column. Each column should be enclosed in a <div class="column"> wrapper, which floats to the left. Code:

Having Trouble Looping Through Records In A MySQL Table
I'm having some trouble looping through the records of a MySQL table using PEAR DB. Here is my code:

$navigationSql = "SELECT * FROM nav";
$navigation =& $db->query($navigationSql);
while ($navigation->fetchInto($nav)){
define("NAVIGATION", "<a href="$nav[2]" target="$nav[3]" title="$nav[1]">$nav[1]</a><br />"); }

The when I enter:
print NAVIGATION;

into any of my PHP scripts it should loop through the stuff in table named nav, but it is only displaying the first record and so far everything I've tried does not seem to make it loop through all of the records in the table and I can't figure out why not.

Word Doc Stored As BLOB In MySQL - Retrieval ?
I've stored a word doc as a LONGBLOB in MySQL. To retrieve the contents of the file, I have a script which creates a temporary file, writes the contents to the file, then auto-redirects the browser to the .doc file; the browser then prompts the user to download the file.

The original .doc, which was uploaded to MySQL and the .doc downloaded from the temp file are the exact same size. However, MS Word won't open the downloaded .doc file, saying that "The document name or path is not valid" Anyone else run into this problem getting Word docs from MySQL?

Displaying Priorty Records And Normal Records In The One Dataset.
I have a page which displays the records from the database and uses paging to display the records in groupes of 10 per page.

I now want to be able to show results depending on the database field (display) in the database (can be set to either "full" or "limited"). If the record and the field display is equal to "full" i want to then display this record at the top of the record set and display all the fields.

If the record is equal to "limited" i want to display different results and they must show after all the records which are equal to "full". I can't output two different recordsets as i use paging and only want to show 10 records per page. Code:

Convert Isnull From SQLServer To MySQL
In a program, I work with SQLServer and MySql. In a particular select,
for SQLServer, I have something like this:

SELECT ISNULL(field,0) FROM TABLE.

If the field is not null, returns its value; otherwise, 0.

I have found isnull for MySQL, but it does not work exactly the same
way.

Any idea to convert that isnull from SQLServer to MySQL?

Convert Mysql Datetime Into Something More Friendly
In an effort to do things "right" I'm now using a datatype of "datetime" in my mysql tables when they contain dates and times - I use to use varchar.

Problem is, when I pull this information out from the db for screen display, my current client freaks.

Instead of the current display of 2006-03-02 19:13:37, he wants it to show March 2, 2006, 7:28pm.

Easy, of course, when I was just using string data... but now, oh, no.

How does one go about converting an accurate datetime type to something like the above?

I Need To Convert Some Chars Before Submitting To MySQL
I'm putting up a website, related to an IRC roleplaying channel, where my players can register their RP-characters in a SQL database, and will afterwards be able to log in, and alter the information they have submitted (name, age, description, sex, etc).

My problem: The players will also submit their IRC nick they use while playing. This produces a problem for me, because IRC nicks can and often do contain special chars like [,],{,} as well as `and . So, whenever I submit a name containing a [ or ], it is read as nothing, and since the registration code requires that particular field to be filled in, it aborts the registration.

What I need: ...is some kind of code which will allow me to submit these characters, and put them into my SQL database. A reference to reading the PHP manual won't do much good, because I know too little about PHP programming (the authorization system I'm using is that of Tim Perdue's at PHPBuilder.com. You can find the whole system here).

I'm also having problems with sentences like "...and it's some kind of..." turning up like "...and it's some kind of..." when I retrieve the data from the database and display it as HTML.

How To Control Access To Specific Mysql Records For A User
I am just trying out a php form, when posted submits data to database. The system is we allow everyone to submit the form. As administrator I can view and edit the records. But whoever submits the form should be a registered user and he should be able to only view his records but not edit.

MySQL Inserting Into Multiple Tables Linked Records
Using MySQL can anyone tell me how to most efficiently insert a collumn
in 'table1' retrieve the id from this record and insert mutliple
records into 'table2' with a collumn for the id in 'table1' which links
the two recordsets

Forcing Word Wrap/ordering Of Draws From Mysql
A: how do i force when i pull data to a table the text to wrap? and B: how do i control order of how it is displayed when it draws from the DB? (ie 07/25/00 11:45pm showing up at the top then 07/25/00 9:45am showing up after that)what i have right now: Code:

Know Any Good Scripts To Convert Msaccess To Mysql
I am tasked with converting an MsAccess db to a MySQL 4 db in a Linux
environment. Can anyone recommend any good freeware/scripts to help me
do this?

How To Access And Modify And Add Records In MySQL Table From A Windows Client?
The MySQL table is located in a Linux Server OS, so I need the
information from that table for updating Paradox tables in Windows OS.
If a PHP program in the Linux Server can save a file with the
information I need, can I make a PHP program in Windows OS to get the
saved file or even better, to access the table in the Linus Server OS?...

Count,sort,diplay Number Of Records In MySQL Table
I am designing a search engine using PHP/MySQL and I am logging all search terms into a MySQL table. I was wondering how I count the number of occurences of a term in the table, and then sort and display the terms in descending order. For example, if the column in my table with search terms looked something like this:

clothes
casinos
clothes
homes
homes
clothes

How can I count and order the records so that I can display according to how many times they appear, like so:

1. clothes(3 entries)
2. home(2 entries)
3. casinos (1 entry)

Need To Update Multiple Mysql Records With A Single Form Submit
I have a wish list like a shoping caty based on a mysql databse where i retrieve records with php I need to update the quantity which is in a text fields :

input type = text name = quantity[] value = $quantity
input type = checkbor value = $id name = id[]

I need to update quantities based on the primary id represented with id with a single submit.

Automatic Delete From MySQL Database Table Expired Records?
I have a question . . .

how can i delete from MySQL database table automatic expired records ?
?

One think is to make a service that deleting the expired records . . .

Any other method ?



How To Convert Carriage Return In Mysql To Excel Format?
I have a varchar field in MySQL table that has carriage returns. I am trying to display this field in an Excel document. When I display this using (php_writeexcel class ) Excel I get small squares due to Excel converting the carriage returns.

Is there a way to convert these carriage returns to display properly. I have already tried str_replace("","",$value) and does not work. Any regular expressions?


Copyright © 2005-08 www.BigResource.com, All rights reserved