Welcome Guest, Not a member yet? Register   Sign In
unable to display values from array in a view
#6

(This post was last modified: 11-25-2017, 01:35 PM by PaulD. Edit Reason: Added PS )

IGNORE THIS:
(Your query is in a for loop so you do not want a single query as written here)

Try replacing your query with this:
PHP Code:
return $this->anotherDb
    
->select('payment_amount', 'payment_description','payment_student')
    ->
where('payment_student', $result[$i]['id'])
    ->
where('date_format(fee_month,"%d-%m%Y") >=date_format(curdate(),"00-%m-%Y")')
    ->
where('payment_status'0)
    ->
get('payments')
    ->
result_array(); 

You also do this
PHP Code:
foreach ($fee_detail as $key => $data) 
But you do not use $key, so just do this:
PHP Code:
foreach ($fee_detail as $data) 

Does that make any difference?

PS I really do not like your for loop to get each student id. Just nest two foreaches, would be cleaner to debug.
Reply


Messages In This Thread
RE: unable to display values from array in a view - by PaulD - 11-25-2017, 01:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB