Featured post
codeigniter - Calling same model function with different parameters not returning values -
soooo....long time reader first time poster. first time, can't find answer!
i've got model returns array of results (working). loop through results foreach , append array additional values second function in model. problem first of several function calls return results. function get_offering_total() returns value first listed call (cash). returning correct value, subsequent attempts use same function returns nothing. var_dump shows array structured correctly on output, values null. there issue calling same model method different parameters? needs cleared/reset?
here's code...
//$data['offerings'] stores results first query
foreach( $data['offerings'] $key => $value ) {
//set filters
$cash_filter = array( 'method' => '5' ); $checks_filter = array( 'method' => '6' );
//get totals
$data['offerings'][$key]['cash'] = $this->model_records->get_offering_total( $value['offering_id'], $cash_filter); $data['offerings'][$key]['checks'] = $this->model_records->get_offering_total( $value['offering_id'], $checks_filter);
...other stuff... }
thanks help!
here's simple test see if code wrote correct. surround in function (in model) within try/catch block, , see if throws kind of exception. you'd surprised how many exceptions thrown php doesn't show them because have error reporting off in php config. can same 2 lines on call method in controller , see if good.
- Get link
- X
- Other Apps
Comments
Post a Comment