I have a query like this:
$this->db->select('acctstarttime, SUM(acctinputoctets) as total');
$this->db->from('radacct');
$this->db->group_by('MONTH(acctstarttime),YEAR(acctstarttime)');
return $this->db->get()->row()->total;
I'm not even calling join(), but the built query contains a JOIN and causes my query to fail:
Not unique table/alias: 'radacct'
SELECT `acctstarttime`, SUM(acctinputoctets) as total FROM `radacct` JOIN `radacct` ON `radcheck`.`username` = `radacct`.`username` GROUP BY MONTH(acctstarttime), YEAR(acctstarttime)
Why is it suddenly doing a JOIN in a query where join() is not called?
Edit: The JOIN is coming from an earlier built query:
$query = $this->db->get('radcheck', $sampai, $dari);
$this->db->join('radacct', 'radcheck.username = radacct.username', $sampai, $dari);
return $query->result_array();
What is happening to make my earlier query corrupt my later query?