Forums

Exporting data

chriso0258 02 Jan, 2014
Hello,

I have used GreyHead's CSV Export v2 [GH] and it works wonderfully. Thank you GH. I was wondering if there is a way to combine data from two tables and then export that information. Specifically, I want to export a list of equipment in east region (from a table that maintains a list of equipment in all regions and which I can do using the where clause in the mysql action tab) but I also want to include the last location for each equipment which comes from a separate table that keeps track of the history of locations for each piece.

I've tested a mysql statement in phpmyadmin to verify I have the correct syntax for getting that last location of a piece of equipment but I'm not sure how to integrate that with CF to get the last location for each piece.

Sorry for the lengthy explanation.

Thanks for your assistance.
GreyHead 10 Feb, 2014
Hi chriso0258,

Sorry, I missed this post earlier. You can use MySQL in a Custom Code action to build as complex a query as you like and then add the results to the $form->data array. The CSV Export [GH] action can read this and export it. The only thing that you need to watch is the number of records, if that gets too big you may run out of memory.

Bob
This topic is locked and no more replies can be posted.