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

(11-25-2017, 10:34 AM)PaulD Wrote: Your problem is that your array does not contain the index 'payment_description' so when you try to output it then php is saying it is not defined, which it is not. It seems you are selecting it though in your model, which is strange.

If I were in this situation, I would first output the query string itself and check it is doing what I expected.  Use $this->db->last_query() as described in docs: https://www.codeigniter.com/user_guide/d...lpers.html

Then run the query that was outputted in your database directly and look at the results. Again, are they what you expected? ie do they have payment description field in them.

If you remove the line for payment description, is your code finding and displaying the payment_amount? If so you are doing nothing wrong in your output, just that the index is not defined for payment_description.

Hope that helps,

Paul.


Hi Paul, 
Thanks for your reply.

$this->db->last_query() 

Return this query 
Quote:SELECT `payment_amount` FROM `payments` WHERE `payment_student` = '44' AND date_format(fee_month,"%d-%m%Y") >= date_format(curdate(),"00-%m-%Y") AND `payment_status` =0


I tested the query in Mysql Workbench, it return data.

I tried only the payment_amount in my view, but still the same error.

Please check the last lines of my view are these correct?
Reply


Messages In This Thread
RE: unable to display values from array in a view - by nadeem14375 - 11-25-2017, 11:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB