DataMapper is only returning the last part of this query
- by Josh K
So I'm using the following:
$r = new Record();
$r->select('ip, count(*) as ipcount');
$r->group_by('ip');
$r->order_by('ipcount', 'desc');
$r->limit(5);
$r->get();
foreach($r->all as $record)
{
echo($record->ip." ");
echo($record->ipcount." <br />");
}
And I only get the last (fifth) record echo'ed out and no ipcount echoed.
Is there a different way to go around this? I'm working on learning DataMapper (hence the questions) and need to figure some of this out. I haven't quite wrapped my head around the whole ORM thing.