Possible Duplicate:
Create a CSV File for a user in PHP
Even though title looks like simple, my question is a little bit different. I need to export my php table's data into CSV file.
My page has simple form which allows users to choose dates, some of other variables and once user submits the form, I create the table. My form's action is to the same page.
Now I want to add a button, to export data table into a CSV file. I create a PHP function to export the data with the current variables.
I couldn't find anything to call php function without using the forms. But when I use form I lost all of the calculations so that I need to post everything again and do the queries again and again.
Is there any other better way to download the table data ?