Welcome Guest, Not a member yet? Register   Sign In
cannot access query results in view: Message: Undefined variable
#2

[eluser]johnmerlino[/eluser]
This fix for this was assigning the object that resulted from result() in an associative array of an array object:

$data = $home->find('all');
$options['records'] = $data;

At that point, the associatve array become available as a variable in view and that variable held an object of key/value pairs from the query, so foreach can be used to iterate through the objects indexed in the array (e.g. $row->title).


Messages In This Thread
cannot access query results in view: Message: Undefined variable - by El Forum - 03-06-2011, 04:09 PM



Theme © iAndrew 2016 - Forum software by © MyBB