Hello
i guess, my problem is trivial, but i still need help ...
What i want is this: display values from a DB in a simple table and then export this table to csv by clicking a 'Submit'-button.
So i did this:
- i put a 'DB Read' in the 'On load'-section, i enable it, choose the DB-Table, enable Multi read, Enable Model ID, name the Model ID 'Agenda' and select the desired fields.
- in the 'On found'-section of the 'DB Read' i put 'HTML (Render Form)'. There i display the values with this code
- with this, the table is displayed correctly. Now i want to save this table to csv, so i put a 'CSV Export' in the 'On submit'-section. I enable it, choose no table and put 'Agenda' in the Data Path.
- If i click submit, i get a csv-file with this content: 'Notice: Undefined variable: data in ...\csv_export.php on line 124. Warning: array_walk() expects parameter 1 to be array, null given in ...\csv_export.php on line 130'
What am i doing wrong?
Thank you!
Daniel
i guess, my problem is trivial, but i still need help ...
What i want is this: display values from a DB in a simple table and then export this table to csv by clicking a 'Submit'-button.
So i did this:
- i put a 'DB Read' in the 'On load'-section, i enable it, choose the DB-Table, enable Multi read, Enable Model ID, name the Model ID 'Agenda' and select the desired fields.
- in the 'On found'-section of the 'DB Read' i put 'HTML (Render Form)'. There i display the values with this code
<table>
<?php
foreach ( $form->data['Agenda'] as $e ) {
echo "<tr>
<td>{$e['datum1']}</td>
<td>{$e['titel']}</td>
<td>{$e['ort']}</td>
</tr>";
}
?>
</table>
and i have a Submit-Button.
- with this, the table is displayed correctly. Now i want to save this table to csv, so i put a 'CSV Export' in the 'On submit'-section. I enable it, choose no table and put 'Agenda' in the Data Path.
- If i click submit, i get a csv-file with this content: 'Notice: Undefined variable: data in ...\csv_export.php on line 124. Warning: array_walk() expects parameter 1 to be array, null given in ...\csv_export.php on line 130'
What am i doing wrong?
Thank you!
Daniel