Need help with data arrays |
Hi,
Got two tables, Staff and Events. For a view, I need to get all the Staff records and, for each record, get a SUM of all the related (by Staffid) amount fields in Events. What I'd like is to have all the data from each record in Staff and the SUM total in the same array ...I just can't figure out a way to do that. Here's what I've got so far ... get all the Staff data and do a foreach loop to call a method to get the SUM total... but how to marry the two together??? Controller: PHP Code: public function list_all_staff() Model method to get sum: PHP Code: function count_events($par_id) |
Messages In This Thread |
Need help with data arrays - by blackbulldog - 03-14-2015, 08:28 AM
RE: Need help with data arrays - by RobertSF - 03-14-2015, 04:01 PM
RE: Need help with data arrays - by blackbulldog - 03-15-2015, 05:04 AM
RE: Need help with data arrays - by RobertSF - 03-15-2015, 05:42 AM
RE: Need help with data arrays - by blackbulldog - 03-16-2015, 04:46 AM
RE: Need help with data arrays - by RobertSF - 03-16-2015, 12:34 PM
RE: Need help with data arrays - by blackbulldog - 03-16-2015, 01:27 PM
RE: Need help with data arrays - by RobertSF - 03-16-2015, 05:36 PM
RE: Need help with data arrays - by RobertSF - 03-16-2015, 03:24 PM
RE: Need help with data arrays - by blackbulldog - 03-17-2015, 01:57 AM
RE: Need help with data arrays - by RobertSF - 03-17-2015, 03:21 AM
|