Forums

How to use db Reader CFv5

chriso0258 25 Jun, 2015
Hello,

I haven't figured out how to use the db reader in CFv5. I notice that the db reader loads each record in an array (see picture)
[attachment=1]debug 2.jpg[/attachment]

How do I display this data? In CFv4 I could just use a custom code like
{location.building}
to display the value in the building column. But now I see it stores each record in an array. What do I write in my custom code to display it?

Thanks for your assistance.
GreyHead 25 Jun, 2015
Hi chriso0258,

Do you want to read multiple records?

If not then turn off the Multiple option in the DB Read and {location.building} should work OK

Bob
chriso0258 25 Jun, 2015
Hello Bob,

Yes, I will need to read multiple records. What I'm really trying to do is to

1. Pull out the records where state_tag_loc (see picture above) matches the eastList.its_equip_id (see picture)
[attachment=0]debug 1.jpg[/attachment]
2. Join several tables to the location table so I can use the value in those tables.

However, at this time I can't even seem to be able to display any records, much less accomplish the two above goals.
chriso0258 26 Jun, 2015
Hello again,

I think my problem is with formatting the Conditions statement. I've tried both of the following and cannot get the proper records selectioned. It ends up selecting all records.

< ?php 
return array([location]['state_tag_loc'] => [eastList]['its_equip_id']); 
?>


< ?php 
return array(['location']['state_tag_loc'] => ['eastList']['its_equip_id']); 
?>


How should I format this Condition statement?

Thanks.
chriso0258 26 Jun, 2015
Answer
Ok. I finally got the right format. It should be:

<?php 
return array('location.state_tag_loc' => $form->data['eastList']['its_equip_id']); 
?>
GreyHead 27 Jun, 2015
Hi chriso0258,

I think that I've just replied to this in another thread.

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