RE: [PHP-DB] MySQL to EXCEL?

2004-08-18 Thread Ed Lazor
> -Original Message-
> 
> You can use
> 
>   
> 
> 
> and each tr becomes an excel row and each td becomes a cell.  This may or
> may not work in/before excel97??
> 
> If you're looking to create true excel files, then i highly suggest
> spreadsheetwrite_excel,
> It is an excellent codeset, enabling you to use many features of excel
> such
> as colors, math, formats, etc.
> 
> doing it this way, is little to no different from exporting in csv format,
> but it does work
> as described.
> 
> HTH
> Jeff

Wow, that's pretty interesting.  I'll play around with it =)

-Ed

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] MySQL to EXCEL?

2004-08-17 Thread jeffrey_n_Dyke



>>
>> I don't know how you have it setup.
>>
>> But you can create a XLS file on the fly using PHP
>>
>> By using header...
>
>> header("Content-Type: application/vnd.ms-excel");
>> header("Content-Dispostion: attachemnt; filename='Project.xls'");
>> header("Pragma: no-cache");
>> header("Expires: 0");
>>
>>
>> Then just echo your results from your query, like normal...

> Could you expound on this?  What field delimiter are you using?

You can use

  


and each tr becomes an excel row and each td becomes a cell.  This may or
may not work in/before excel97??

If you're looking to create true excel files, then i highly suggest
spreadsheetwrite_excel,
It is an excellent codeset, enabling you to use many features of excel such
as colors, math, formats, etc.

doing it this way, is little to no different from exporting in csv format,
but it does work
as described.

HTH
Jeff


>
>
> You have just created a XLS from PHP...Which can be saved to a XLS
> Workbook...

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] MySQL to EXCEL?

2004-08-17 Thread Ed Lazor
> -Original Message-
> From: Daniel Brunner [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 17, 2004 2:45 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] MySQL to EXCEL?
> 
> I don't know how you have it setup.
> 
> But you can create a XLS file on the fly using PHP
> 
> By using header...
> 
> header("Content-Type: application/vnd.ms-excel");
> header("Content-Dispostion: attachemnt; filename='Project.xls'");
> header("Pragma: no-cache");
> header("Expires: 0");
> 
> 
> Then just echo your results from your query, like normal...

Could you expound on this?  What field delimiter are you using?


> 
> 
> You have just created a XLS from PHP...Which can be saved to a XLS
> Workbook...

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] MySQL to EXCEL?

2004-08-17 Thread Daniel Brunner
I don't know how you have it setup.
But you can create a XLS file on the fly using PHP
By using header...
header("Content-Type: application/vnd.ms-excel");
header("Content-Dispostion: attachemnt; filename='Project.xls'");
header("Pragma: no-cache");
header("Expires: 0");
Then just echo your results from your query, like normal...
You have just created a XLS from PHP...Which can be saved to a XLS 
Workbook...


Dan



On Aug 17, 2004, at 4:33 PM, [EMAIL PROTECTED] wrote:
I have another option that might work for you also.  Go to MySQL's 
website
and grab their ODBC driver and use that to pull data directly into 
Excel.
That's what I do and the end result tends to be a lot cleaner than 
going
through cvs or other MySQL exports.
I was not sure that this was a mysql db.
sorry for the second email, I see now in the subject of the email it
is mysql, stupid me.
You could also try an excel com object to do this.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] MySQL to EXCEL?

2004-08-17 Thread Matt M.
> > I have another option that might work for you also.  Go to MySQL's website
> > and grab their ODBC driver and use that to pull data directly into Excel.
> > That's what I do and the end result tends to be a lot cleaner than going
> > through cvs or other MySQL exports.
> 
> I was not sure that this was a mysql db.

sorry for the second email, I see now in the subject of the email it
is mysql, stupid me.

You could also try an excel com object to do this.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] MySQL to EXCEL?

2004-08-17 Thread Matt M.
> I have another option that might work for you also.  Go to MySQL's website
> and grab their ODBC driver and use that to pull data directly into Excel.
> That's what I do and the end result tends to be a lot cleaner than going
> through cvs or other MySQL exports.

I was not sure that this was a mysql db.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] MySQL to EXCEL?

2004-08-17 Thread Ed Lazor
> -Original Message-
> either output the data as a csv which you are doing (on windoze name
> the file with a .csv extension) or take a look at
> http://pear.php.net/package/Spreadsheet_Excel_Writer

I have another option that might work for you also.  Go to MySQL's website
and grab their ODBC driver and use that to pull data directly into Excel.
That's what I do and the end result tends to be a lot cleaner than going
through cvs or other MySQL exports.

-Ed

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] MySQL to EXCEL?

2004-08-17 Thread randy
You could always use phpMyAdmin...I believe it will export to Excel
(if not, CSV file).

http://phpmyadmin.sourceforge.net/



On Tue, 17 Aug 2004 15:36:49 -0400, Chris Payne
<[EMAIL PROTECTED]> wrote:
> Hi there everyone,
> 
> I'm having a dilemma (Now that I have power back after the hurricane hit us
> directly in Orlando).  Anyway, I need to export a database table to Excel, I
> can do it as a .txt file without a problem, but I can't seem to get it to
> put each column into a separate cell when I try to export as an .xls form, I
> think I have this line formed incorrectly for an XLS file, can anyone see if
> I need to use any special characters rather than a comma?
> 
> fwrite($filesession,"$id,$new,$recno,$category,$product,$description,$unit,$
> certificate,$instock,$orderpt,$ordernow,$vendor,$unitcost,$unitsell\015\012"
> );
> 
> Thank you.
> 
> 
> Chris
> 
> 


-- 
randy [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] MySQL to EXCEL?

2004-08-17 Thread Matt M.
> I'm having a dilemma (Now that I have power back after the hurricane hit us
> directly in Orlando).  Anyway, I need to export a database table to Excel, I
> can do it as a .txt file without a problem, but I can't seem to get it to
> put each column into a separate cell when I try to export as an .xls form, I
> think I have this line formed incorrectly for an XLS file, can anyone see if
> I need to use any special characters rather than a comma?
> 
> fwrite($filesession,"$id,$new,$recno,$category,$product,$description,$unit,$
> certificate,$instock,$orderpt,$ordernow,$vendor,$unitcost,$unitsell\015\012"
> );
> 


either output the data as a csv which you are doing (on windoze name
the file with a .csv extension) or take a look at
http://pear.php.net/package/Spreadsheet_Excel_Writer

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] MySQL to EXCEL?

2004-08-17 Thread Chris Payne
Hi there everyone,

 

I'm having a dilemma (Now that I have power back after the hurricane hit us
directly in Orlando).  Anyway, I need to export a database table to Excel, I
can do it as a .txt file without a problem, but I can't seem to get it to
put each column into a separate cell when I try to export as an .xls form, I
think I have this line formed incorrectly for an XLS file, can anyone see if
I need to use any special characters rather than a comma?

 

fwrite($filesession,"$id,$new,$recno,$category,$product,$description,$unit,$
certificate,$instock,$orderpt,$ordernow,$vendor,$unitcost,$unitsell\015\012"
);

 

Thank you.

 

Chris