ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

how to export CSV with loop or php from read_data1

samir1903 23 Oct, 2019
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 23 Oct, 2019
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;
samir1903 23 Oct, 2019
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 23 Oct, 2019
$array[] supposed to be square brackets there
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com