0
Hello, I would like to know how to recover a result from a select in Controller to perform a sum of variables. I have two selects that I need the resulting value of them to add 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
I don’t understand, what is the error? Select you refer to Query SQL?
– Sveen