I am currently working on the export side of my site to allow users the ability to view data held on a MySQL database. Currently I have a working solution that passes all the data selected in a query to a .CSV file.
The problem I am having is that I want to be able to let users select their own data and then be able to export the displayed data to a spread sheet rather than the whole table.
My first thought to solving this problem would be to perhaps store the query executed into a variable and then include it when using the export script.
Would this method be recommended or am I straying on the wrong path? If anyone can help I would be very grateful.
Also if this question is not suitable, please can you justify why. All feedback will be useful for future posts.