Welcome Guest, Not a member yet? Register   Sign In
help noob with select_sum
#1

[eluser]xxIdroxx[/eluser]
Hello everyone, I'm a beginner with CodeIgniter and I need to select a field to a table and add up all the data I can find.
I tried to do this script but it goes:
Code:
$query = $this->db->get_where($this->session->userdata('universe').'_alleanza_utenti', array('ally_id' => $param5));
     $this->db->select_sum('points');
  foreach ($query->result_array() as $row)
{
    $query1 = $this->db->get_where($this->session->userdata('universe').'_users', array('id' => $row['user_id']));
}
  $row = $query1->row();
  
     echo number_format($row->points);


Messages In This Thread
help noob with select_sum - by El Forum - 01-27-2012, 11:18 AM
help noob with select_sum - by El Forum - 01-27-2012, 12:46 PM
help noob with select_sum - by El Forum - 01-27-2012, 01:10 PM
help noob with select_sum - by El Forum - 01-27-2012, 01:18 PM
help noob with select_sum - by El Forum - 01-27-2012, 02:16 PM
help noob with select_sum - by El Forum - 01-28-2012, 05:10 AM
help noob with select_sum - by El Forum - 01-28-2012, 08:10 AM
help noob with select_sum - by El Forum - 01-28-2012, 08:48 AM
help noob with select_sum - by El Forum - 01-28-2012, 09:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB