This is a discussion on "webpage to excel or csv" within the PHP Forum section. This forum, and the thread "webpage to excel or csv are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
webpage to excel or csv
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|
|
||||
|
Re: webpage to excel or csv
It would be better to use database.
you can query it and show the results.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
||||
|
Re: webpage to excel or csv
This is actually something I haven't done. Here is how I'd get started, in case you don't get anything better:
Most SQL flavors will handle a csv-type export for you. (There are some advantages to a tab-delineated download for Excel, IIRC.) So I guess my first approach would be to look at database functions. I've only done it with MySQL using phpMyAdmin, but logically, there must be a function sequence, which means you should be able to access it via a GET or POST request to the db. Since that would mean that the PHP is simple and the database function is more advanced, I'd ask this question in the appropriate db Forum. As another possibility, you could format a query so that the result prints as a csv file, then let your user copy and paste it into a Notepad file and save it wherever he wanted. This would eliminate the hard part -- unless I'm missing something, you should be able to do this off the top of your head by simply structuring the PHP output, avoiding download management code -- but it wouldn't be nearly as slick. Again, it has been a while since I worked with this format, so it might need some instructions to the user about exactly how to save it; don't you use a *.csv extension and save as "All Files"? Last edited by masonbarge; Dec 9th, 2007 at 11:52. |
|
||||
|
Re: webpage to excel or csv
Surely for a CSV, you will need to use the implode() function to add commas to the data then just write that to the file?
After all, CSV stands for Comma Seperated Values. |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Anyone know much about Excel | AdRock | Webforumz Cafe | 8 | Sep 29th, 2007 19:58 |
| Excel Thru Recovery | Chase42304 | Graphics and 3D | 3 | Nov 27th, 2006 14:21 |
| Excel problem | madhuri.t | Classic ASP | 1 | Mar 7th, 2006 01:23 |
| Excel to ASP... | courtjester | Classic ASP | 14 | Sep 27th, 2004 20:44 |