"> Echo DB Read result - Forums

Forums

Echo DB Read result

enzo.orsi 02 Sep, 2015
Hi,
I have a DB Read with a relation within two tables, this is the debug for one sample record:

[0] => Array
        (
            [risposta] => Array
                (
                    [id] => 1
                    [user_id] => 998
                    [form_id] => 64
                    [created] => 2015-08-28 15:34:14
                )

            [ip] => Array
                (
                    [id_risposta] => 1
                    [form_id] => 64
                    [user_id] => 998
                    [created] => 2015-08-27 12:50:49
                    [ip_address] => 2.228.101.1
                )
        )


I am trying to print all the records in this arrays, but I am getting this error "Warning: Invalid argument supplied for foreach()", probably because it is a double array. Do you have any ideas how to change the below code?

<?php
foreach ( $form->data['risposta'] as $p ) {
  echo $p['id'];
}
?>
This topic is locked and no more replies can be posted.