Forum Moderators: coopster
Generating a CSV for Download from MySQL [webmasterworld.com]
it creates the file for download only and prompts with an 'open/save as' dialog.
Use something like a drop down list (or a calendar script) to create your query. Modify the script to use the data from your page to construct the query and you should end up with happy customers.