CodeIgniter Forums
[PENDING] Exporting data to files (which plugins ?) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: [PENDING] Exporting data to files (which plugins ?) (/thread-2160.html)



[PENDING] Exporting data to files (which plugins ?) - El Forum - 07-19-2007

[eluser]Morty[/eluser]
Hi there!

I am quite successful in building my first CI application, and since I now have good results coming from my database, I would like to export them to Excel-readable files. There seems to be plugins/libraries to export QUERIES (or query results) directly to CSVs (or XLS) but I want to modify some of my results before sending them to CSV files.

- Is it possible to change query results, like adding columns and entries ?
- Which libraries / plugins are available to export data ?

Thanks in advance,
Morty


[PENDING] Exporting data to files (which plugins ?) - El Forum - 07-19-2007

[eluser]Glen Swinfield[/eluser]
To change a query result you need to change the query. Query result = result of query.

But you can operate on a php array created from a query result, you'll need some array functions though.


[PENDING] Exporting data to files (which plugins ?) - El Forum - 07-19-2007

[eluser]Morty[/eluser]
I can't change the query to display what I actually want because some of my info need to be aggregated.

Example:
idSite | Where | Qty
ALO | C5 | 10
ALO | C6 | 10

I need to save:

idSite | C5 | C6
ALO | 10 | 10

That's of course simplified.