Buy Now
Sign in

how to export CSV with loop or php from read_data1

samir1903 , October 23 2019, 03:37
S
samir1903 185
October 23 2019, 03:37 #389665
in connectivity i can calculate things example
$total = $this->get("data_table.row.Model.calculation"); if ($total > 0) {echo $total; } else { echo 'nothing';}
to export this in a csv is kind of complex for me i couldnt do it
Can anyone help with this please
healyhatman 9
October 23 2019, 04:30 #389666
Return an array, and use that array as the data source for the CSV action. Like
$array = 
  • ;
    foreach($this->get("data_table.[n].Model.calculation) as $calc") {
    $array
  • = $calc > 0 ? $calc : "Nothing";
    }
    return $array;
    Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
    Donations: paypal.me/healyhatman
    Professional Work: kamron@skyspider.com.au
    Custom CF / CC Plugins and Extensions: skyspider.com.au/store
    S
    samir1903 185
    October 23 2019, 13:30 #389710
    It is not working
    $array =
    ;
    foreach($this->get("data_table.[n].Model.calculation") as $calc) {
    $array
    = $calc > 0 ? $calc : "Nothing";
    }
    return $array;
    result
    syntax error, unexpected ';'
    healyhatman 9
    October 23 2019, 13:33 #389711
    $array[] supposed to be square brackets there
    Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
    Donations: paypal.me/healyhatman
    Professional Work: kamron@skyspider.com.au
    Custom CF / CC Plugins and Extensions: skyspider.com.au/store