すっごく、私はこの機能を持っています
public function playerslist()
{
$this->load->database();
$data = $this->db->get('skaters')->result();
$this->load->helper('url');
$this->load->view('playerslist', array('data' => $data));
}
そして、私がやろうとしているのは、ビューで foreach を使用して、そのようなデータを返すことです
<?php
foreach($data as $row => $value){
echo $row;
}
?>
そしてそれはただ0を返します...私はやった
<?php
print_r($data);
?>
そしてそれはこれを返しました....
Array ( [0] => stdClass Object (
[id] => 1
[firstname] => Steve
[lastname] => Stamkos
[position] => F
[team] => TBL
[gp2013] => 0
[g2013] => 0
[a2013] => 0
[pm2013] => 0
[pim2013] => 0
[ppg2013] => 0
[ppa2013] => 0
[shg2013] => 0
[sha2013] => 0
[s2013] => 0
[s%2013] => 0
[fp2013] => 0
[gp2012] => 82
[g2012] => 60
[a2012] => 0
[pm2012] => 0
[pim2012] => 0
[ppg2012] => 0
[ppa2012] => 0
[shg2012] => 0
[sha2012] => 0
[s2012] => 0
[s%2012] => 0
[fp2012] => 0
[gp2011] => 0
[g2011] => 0
[a2011] => 0
[pm2011] => 0
[pim2011] => 0
[ppg2011] => 0
[ppa2011] => 0
[shg2011] => 0
[sha2011] => 0
[s2011] => 0
[s%2011] => 0
[fp2011] => 0
[gp2010] => 0
[g2010] => 0
[a2010] => 0
[pm2010] => 0
[pim2010] => 0
[ppg2010] => 0
[ppa2010] => 0
[shg2010] => 0
[sha2010] => 0
[s2010] => 0
[s%2010] => 0
[fp2010] => 0
) )
私は何を間違ってい$data
ますか? foreachで使用しますか?