Welcome Guest, Not a member yet? Register   Sign In
for loops in model that return an array
#4

[eluser]theprodigy[/eluser]
Change:
Code:
function get_pball_counts()
{
    for(  $i =1; $i <= 39 ; $i++ )
    {
        $this->db->select('count(*)',false);
        $this->db->where('pball', $i);
        $result = $this->db->get('pball');

        $pball[$i] = $result->num_rows();
    }

    return $pball;
}
to:
Code:
function get_pball_counts()
{
    for(  $i =1; $i <= 39 ; $i++ )
    {
        $this->db->select('count(*) as `drawn`',false);
        $this->db->where('pball', $i);
        $result = $this->db->get('pball');
        $row = $result->row();
        $pball[$i] = $row->drawn;
    }

    return $pball;
}


Messages In This Thread
for loops in model that return an array - by El Forum - 02-08-2010, 04:46 PM
for loops in model that return an array - by El Forum - 02-08-2010, 05:49 PM
for loops in model that return an array - by El Forum - 02-08-2010, 07:17 PM
for loops in model that return an array - by El Forum - 02-08-2010, 07:24 PM
for loops in model that return an array - by El Forum - 02-08-2010, 07:26 PM
for loops in model that return an array - by El Forum - 02-08-2010, 07:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB