I’m having trouble iterating through results in an active record object. Can someone provide a code example please.
$data = MyTable::model()->with('MyOtherTable')->find(...);
$eg = $data->myColumnFromMyTable;
$data->iterator->next();
$eg = $data->myColumnFromMyTable; // value still the same as before
Further more I need to do this across a table join, but haven’t worked out how to do it on a single table yet.
Yes, I worked it out. I always answer my own posts if I work it out. Hopefully it will help someone else (maybe even me in a few a months time!). But thanks anyway.