Output to excel file ???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pha3dr0n
Forum Newbie
Posts: 9
Joined: Mon Sep 02, 2002 9:12 am

Output to excel file ???

Post by pha3dr0n »

Got a tricky one here, and I have no idea how to go about it.

I have a mysql db, lets say of music cd's (not really, but easy to explain). The data stored is Artist, Album, No of CD's, Genre.

I have a search html page (with php), where I can search on any data typr, and get the results. What I want to do is script in a button beside every result that is returned, whereupon when it is clicked, it copies the data into a formatted excel sheet. Preferably set so that nothing changes in the search results page - you click the button, the data is added to the excel sheet, but the search results page remains unchanged, allowing you to click on all the returned results without having to redo the search.

Like I say - the mysql db is running fine, and the search page is running fine. The results page lists all the results in a table.

I know what I want to be able to do, but have no idea how to go about it (I am on my 4th php/mysql book, and am still getting nowhere with this).

Cheers,

Pha3dr0n
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

have you tried opening a new browser window to run the php script to generate the file and download options? is that the sort of thing you are looking to do?

if you want to do it client side, you could use javascript which can now create files on the local machine and pull the information out of the html document, but this is very browser dependent and the user could have turned off javascript. etc. etc.
Post Reply