Hi,
I'm having an issue trying to load data from two separate tables in one form. Basically what I'm hoping to achieve is to read info from the user registration table and then go and get more info about each user from another table I have set up, and then display it all.
I have set up a db multiloader with the following in the where clause;
I've done it like this because I want to add more conditions latter. I'm loading data into the Model ID UserDetails.
Next I have placed a DB Loader into the "On Record Found' event of the DB multi loader (I assume this is the right place for it?) I have the following code in the where clause of the DB loader.
I am loading this info into the UserPersonal Model ID.
Finally I have a custom code element to create the table with all the data.
When the form runs, I get the info from the multidata loader, but not from the other table. Adding a debugger gives me the following;

Clearly the 'Userdetail' data is not been seen in the DB loader, as there is nothing in the 'where' clause, but that data is been seen subsequently in the custom code to display in the table!
I'm confused!
Any help would be appreciated.
Nick
I'm having an issue trying to load data from two separate tables in one form. Basically what I'm hoping to achieve is to read info from the user registration table and then go and get more info about each user from another table I have set up, and then display it all.
I have set up a db multiloader with the following in the where clause;
<?php
$where = array();
$where[] = "`id` > 0";
$where = implode(' AND ', $where);
echo $where;
?>
ORDER BY UserDetails.name
I've done it like this because I want to add more conditions latter. I'm loading data into the Model ID UserDetails.
Next I have placed a DB Loader into the "On Record Found' event of the DB multi loader (I assume this is the right place for it?) I have the following code in the where clause of the DB loader.
<?php
$detail = $form->data['UserDetails']; ?>
`cf_user_id` = '<?php echo $detail['id']; ?>'
I am loading this info into the UserPersonal Model ID.
Finally I have a custom code element to create the table with all the data.
<table frame="box" width="700" cellpadding="5">
<?php foreach($form->data['UserDetails'] as $detail):
$userpersonal = $form->data['UserPersonal'];?>
<tr>
<td><?php echo $detail['id']; ?></td>
<td><?php echo $detail['name']; ?></td>
<td><?php echo $userpersonal['input_phone']; ?></td>
<td><?php echo $detail['email']; ?></td>
</tr>
<?php
endforeach;
?>
</table>
When the form runs, I get the info from the multidata loader, but not from the other table. Adding a debugger gives me the following;
Clearly the 'Userdetail' data is not been seen in the DB loader, as there is nothing in the 'where' clause, but that data is been seen subsequently in the custom code to display in the table!
I'm confused!
Any help would be appreciated.
Nick