I am using a framework, and I am having an issue with getting the results of this particular associative array. All others work except for this one and I am not sure why. This one only returns one result. Here is what I have in my model:
public function listStats($id) {
$sql = DB::inst()->query( "SELECT *
FROM ".
TP."tracking
WHERE
mID = '$id'
GROUP BY
mID"
);
$data = array();
if($sql->num_rows > 0) {
while($row = $sql->fetch_assoc()) {
$data[] = $row;
}
return $data;
}
}
And here is what I have in my view:
<?php foreach($this->listStats as $k => $v) : ?>
<tr>
<td>
<?php echo clean($v['email']); ?>
</td>
</tr>
<?php endforeach; ?>
Any help with figuring this out is greatly appreciated.