Forums

Display DB Read in email with multiple record rows

alxben 01 Nov, 2014
Hello and thank you for providing such a wonderful product. I would like to get some help with setting up my form to display multiple rows from a db read. My form has a db read with the following condition:

<?php
return array("shift_date" => $form->data("shift_date"));
?>


The data array is [attachment=0]Screen Shot 2014-10-31 at 8.46.56 PM.png[/attachment] and the debug shows [attachment=1]Screen Shot 2014-10-31 at 8.47.14 PM.png[/attachment].

I would like to display these records in an email (e.g., $row = $db->loadRowList();) but I cannot figure out how to insert the code correctly and get an output. Any help is greatly appreciated.

Have a wonderful day!
Alex
GreyHead 01 Nov, 2014
Answer
Hi Alex,

The query looks OK but there is no sign here of any data being found?

The code to output results would be something like this:
<table>
<?php
foreach ( $form->data['Data'] as $d ) {
  echo "<tr>
    <td>{$d['task_date']}</td>
    <td>{$d['task']}</td>
    . . .
  </tr>";
}
?>
</table>

Bob
alxben 12 Nov, 2014
Thanks Bob,

Your answer worked perfectly. I had not enabled "Model ID' in the DB Read. Have a great week!

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