Welcome Guest, Not a member yet? Register   Sign In
Form used in new and edit mode
#6

[eluser]Samuurai[/eluser]
I think i'm having a bit of a dull moment, but I was looking at my code and wondering if I do really need a foreach when displaying the query results.

My model does the query and returns $query->result();

I then pass that to my view as $data->result

Then in my view I do a

foreach($result as $row)

Then I access the data using $row->firstname or whatever.

I want to pass the data to my views from the controller.. I've tried various differnt combinations of $result->row()->firstname, but I keep getting errors like "Call to member function on a non-object.

Do I really need the foreach?


Messages In This Thread
Form used in new and edit mode - by El Forum - 09-23-2009, 11:17 AM
Form used in new and edit mode - by El Forum - 09-23-2009, 11:45 AM
Form used in new and edit mode - by El Forum - 09-23-2009, 12:29 PM
Form used in new and edit mode - by El Forum - 09-23-2009, 02:22 PM
Form used in new and edit mode - by El Forum - 09-23-2009, 04:07 PM
Form used in new and edit mode - by El Forum - 09-24-2009, 08:04 AM
Form used in new and edit mode - by El Forum - 09-24-2009, 08:32 AM
Form used in new and edit mode - by El Forum - 09-24-2009, 08:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB