0

In my controller : I have function like this :

$this->admindata->examview($a,3);

In model, I just have function like this :

function examview($examid, $examtipe){
   $this->db->select("exam_id");
   $this->db->from("mainexam");
   $query = $this->db->get()
   return $query->result();
}

And i got error :

Column 'id_group' in field list is ambiguous

SELECT `mu`.`obli`, `mu`.`id_exam_question`, `p`.`id_question`, `question`, `type_question`, `m`.`id_gabungan`, `p_parent`, `id_group` FROM (`exam`, `exam` mu) LEFT JOIN `randomexam` c ON `mu`.`id_group`= `c`.`id_question_order` LEFT JOIN `question` p ON `p`.`id_question` = `c`.`id_question` LEFT JOIN `main` m ON `m`.`id_question` = `p`.`id_question` WHERE `mu`.`id_exam` = '10' GROUP BY `mu`.`id_exam_question` ORDER BY `question_type` asc, LIMIT 0

I don't even have JOIN in my function. And If I delete $this->admindata->examview($a,3), My error has gone. Codeigniter try to call other function I think.

1 Answers1

1

Nah it's tripping up on something else, a query before this one is in need of fixing. Your query here would be like

SELECT exam_id FROM mainexam;

PHP & MYSQL: How to resolve ambiguous column names in JOIN operation?

Try to track down the query causing the error and apply bandages.

Community
  • 1
  • 1
qwertzman
  • 784
  • 1
  • 9
  • 23