Hello, I would like to know how to retrieve a result from a select in Controller to perform a sum of variables. I have two selects that need the value resulting from them to add up inside the Controller.
// A = select total ja proposto
$this->db->select('SUM(tb_proposicao.valor) as totalproposto');
$this->db->where('tb_proposicao.usuarioid', 1;
$this->db->where('tb_proposicao.tipoid', 1;
$dados['totalproposto'] = $this->db->get('tb_proposicao')->result();
// B = select limite
$this->db->select('*');
$this->db->where('tb_limites.usuarioid', 1;
$this->db->where('tb_limites.tipoid', 1;
$dados['limites'] = = $this->db->get('tb_limites')->result();
$A + $B = $C