This topic is locked
[SOLVED]

Loop through list and export separate csv files

7/8/2022 9:32:29 AM
PHPRunner General questions
Dalkeith author

Application dealing with whisky casks.

Lets say there are 1,000 casks and they belong to four accounts 1 , 2, 3 and 4

Each cask collects a nightly charge for storage during the month of June.
100 casks belong to account 1
500 to acocunt 2
200 to 3 and 300 to 4

Can anyone point me how I would have a button that you press and it export 4 csv files named Account1June / Account2June / Account3June and Account4June

The idea is to have it dynamic so if the number of casks change or the number of accounts change or the selected period change it does this for the period..

Thanks in advance for any ideas / pointers

Sergey Kornilov admin 7/8/2022

I don't really see anything related to PHPRunner in this task, just a generic PHP question. Note that you cannot send four files to the output at the same time, browser will only let you download a single file. Probably you can create those CSV files in some temporary folder, zip them together and then send zip file to the output.

In regards to creating and saving PHP files check this thread for instance:
https://stackoverflow.com/questions/17024561/create-csv-and-save-on-local-server-automatically

Dalkeith author 7/8/2022

Thanks will give it a go