Re: Print MySQL DB as Exel File?
| From: | Andrew Hill | Date: | Thu, 15 Mar 2001 03:15:55 +0000 |
| Subject: | Re: Print MySQL DB as Exel File? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-43958@lists.php.net to get a copy of this message | ||
While not directly involving PHP, you certainly open up a database table in
Excel, just create it as a pivot table or data import from a DSN. You can
create spreadsheets based on specific SQL queries and table joins, that
Excel will work happily with.
Hope this helps!
Best regards,
Andrew
---------------------------------------
Andrew Hill - OpenLink Software
Director Technology Evangelism
eBusiness Infrastructure Technology
http://www.openlinksw.com
On 3/14/01 9:28 PM, "Jason Murray" <Jason.Murray@melbourneit.com.au> wrote:
>> Could anyone help me out with how to print the entire contents of a
>> database as an Excel file? I'm familiar with the header:
>>
>> header("Content-Type: application/vnd.ms-excel");
>>
>> just not sure how to go about it beyond that. I have this code and
>> am not sure what do do after it. Thanks.
>
> Excel spreadsheets are in a proprietary format as far as I know.
>
> However, if you output the database one line = one row, and tab delimit
> the lines, Excel will notice you're importing a text file and give you
> some appropriate options (select delimiter, etc).
>
> I'd go for tab delimiting over comma delimiting, since your text fields
> will probably contain commas but will *very* *exceedingly* rarely have
> tabs.
>
> I've ripped some code out of phpMyAdmin to do this (ta Tobias, if you're
> watching ;)) - I can post it if you want to.
>
> Jason