NYCPHP Meetup

NYPHP.org

[nycphp-talk] (no subject)

Peter Sawczynec ps at pswebcode.com
Fri Mar 3 13:48:01 EST 2006


>From Zend this link: 
http://www.zend.com/zend/spotlight/creating-zip-files3.php 
Part 3 of a 3-part tut on building a PHP class that zips files.

Another PHP class to do this: 
http://www.phpclasses.org/browse/package/945.html

Peter




-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of jlesidt
Sent: Friday, March 03, 2006 1:23 PM
To: NYPHP Talk
Subject: Re: [nycphp-talk] (no subject)


Thaks Peter. I have already done this successfully. The problem is when I
try to download more that 65000 rows. In this case, I want to split them
into two excel files and give the user a zip file. I want to create zip file
on the file with these excel files. Is there a way to do this?

Peter Sawczynec <ps at pswebcode.com> wrote: 
This does not exactly solve the specific issue noted here, but this could be
useful for anyone who needs to turn the tabular data output from a database
into an Excel file on the fly. You can do this:

At the very top, first lines of code. No spaces ahead of this because this
is headers:
header("Content-Type: application/vnd.ms-excel");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");

//START: GET DATA
//Make your db connection
//Get your data
//END: GET DATA

//START: DATA DISPLAY
//Format you data accurately and consistently with HTML tables, whatever
//END: DATA DISPLAY
?> 

This PHP page will force message box the user's browser 
if they have Excel on their desktop with option to save or open Excel file. 
And the data will be in nice cells and rows that match 
how you had setup your HTML above. 

I have used this successfully.

Peter


-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of jlesidt
Sent: Friday, March 03, 2006 12:01 PM
To: talk at lists.nyphp.org
Subject: [nycphp-talk] (no subject)


Hi,

I am looking to download rows of data from Mssql database in php. I want
to make an excel file of these rows and zip it so the users can download zip
files. Can someone tell me how to go about with this?

Thanks,

_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
New York PHP Conference and Expo 2006
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php




More information about the talk mailing list